objective c - Twilio crash while building the app in device in IOS -


i have added twilio sdk , libjingleconnection through cocoa pods.

twilio libraries libssl.a , libcryto.a getting conflicts libjingle_connection libraries libwebrtc.a twilio crashing.. without integrating libjingle_connection.

twilio integration working fine.!

it similar below problem

when using twilio ios sdk , building cordova app openssl crashes

but need keep both libjingle_connection , twilio in project.

when build app in device. app crashing below..

twilio_crash

my other linker flags -objc , $(inherited)

i not able find cause of crash..

please suggest solutions fix error..

thanks in advance...!

hiii ,

please follow steps integrate twilio in app .

step 1 : import required frameworks

enter image description here

step 2: copy headers , library folders project .

step 3: add other linker flags ( not -objc -ltwilioclient,-lcrypto,-lssl)

enter image description here

step 4: add header , library search paths

path of header folder copied : $(srcroot)/headers

path of library folder copied : $(srcroot)/libraries

step 5: add prefix header file

#import <availability.h> #ifndef __iphone_4_0 #warning "this project uses features available in ios sdk 4.0 , later." #endif #ifdef __objc__ #import <uikit/uikit.h> #import <foundation/foundation.h> #import <coredata/coredata.h> #endif 

make precompile prefix header yes in build settings , , path of .pch file .

after steps project should compile , build , can run , use twilio need generate capabilities token .

step 6 :from twilio's basicphone example copy basicphone.h , basicphone.m file in project .

then in appdelegate create global object can access through out in project .

in appdelegate.h

@class basicphone; @interface appdelegate : uiresponder <uiapplicationdelegate>{   basicphone *_phone; } @property (strong, nonatomic)basicphone *phone; 

synthesize in appdelegate.m file

@synthesize phone = _phone; - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { if ([uiapplication instancesrespondtoselector:@selector(registerusernotificationsettings:)]){     /* ios 8.0 later */     [application registerusernotificationsettings:[uiusernotificationsettings settingsfortypes:uiusernotificationtypealert|                                                    uiusernotificationtypebadge|                                                    uiusernotificationtypesound                                                                                     categories:nil]]; }    self.phone = [[basicphone alloc] init]; } 

step 7: capabilities token :

check link how generate capabilities token .

step 8 : create makecall.php file , in twiml app (twilio acc) set it's link making calls .

step 9 : xcode register client .

in basicphone.h file

#define bpdefaultclientname @"abc" #define bpcapabilitytokenkeyincomingclient @"abc" 

and in basicphone.m method must have function

getcapabilitytokenwithparameters 

change urlstring there capabilitiestoken url .

if want both incoming , out going capabilities token url should :

https://abc.herokuapp.com/token?allowoutgoing=true&client=abc 

step 10 : in viewcontroller.h login twilio

create object of basicphone

@class basicphone; @interface viewcontroller : uiviewcontroller{  basicphone* _phone; } @property (nonatomic,retain) basicphone* phone; 

in viewcontroller.m

@synthesize phone=_phone; - (void)viewdidload { [super viewdidload]; appdelegate* delegate = (appdelegate*)[uiapplication sharedapplication].delegate;     basicphone* basicphone = delegate.phone;      [basicphone login]; } 

to make outgoing calls :

nsdictionary* dictparams = [nsdictionary dictionarywithobjectsandkeys:@"xyz", @"to", nil]; nslog(@"%@",dictparams); appdelegate* delegate = (appdelegate*)[uiapplication sharedapplication].delegate; basicphone* basicphone = delegate.phone; [basicphone connectwithparams:dictparams]; 

this how did , working without issue .

i feel if helps .


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -