forcedotcom / SalesforceMobileSDK-CordovaPlugin

Cordova plugin for the Salesforce Mobile SDK
Other
47 stars 114 forks source link

iOS: App not proceeding after SplashScreen when cordova-plugin-splashscreen is present along with Salesforce Mobile SDK 8.3.0 #539

Closed akshaybabus closed 1 year ago

akshaybabus commented 3 years ago

In iOS, I am getting the exception "*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SFHybridViewController setEnabledAutorotation:]: unrecognized selector sent to instance" when using the Salesforce Mobile SDK with Cordova Splashscreen plugin. Once I fix this by replacing CDVViewController with SFHybridViewController in a duplicate copy of CDVSplashScreen.m, I am getting stuck at the splash screen when I launch the app. This is occuring only when I set shouldAuthenticate in the bootconfig.json to false. When I set shouldAuthenticate in the bootconfig.json to true, the app, I'm able to see the salesforce login screen.

Steps to Replicate:

Create a forcehybrid project Add the platform cordova-ios@5.1.1 Add the plugin cordova-plugin-splashscreen Add the plugin Salesforce Mobile SDK Cordova Plugin 8.3.0 Set the value of "shouldAuthenticate" as false in the bootconfig.json Run the command "cordova prepare" Build and run the app in the simulator. The issue will be experienced. Environment: Node 12.16.3 NPM 6.14.4 Cordova 9.0.0 cordova-ios 5.1.1 Salesforce Mobile SDK Cordova Plugin 8.3.0 cordova-plugin-statusbar 2.4.3 macOS Cataline 10.15.5 Xcode 11.5

SFHybridViewController+SplashScreen.h image

SFHybridViewController+SplashScreen.m image

image

I would really appreciate your resolution. Thanks in advance.

wmathurin commented 3 years ago

We are very bandwidth constrained especially when it comes to looking at 3rd party plugin. Could you try posting on https://salesforce.stackexchange.com/questions/tagged/mobilesdk and maybe someone in the community has already encountered or solved your issue?

ftfeiteng commented 3 years ago

this worked for me when I removed libCordova.a from Targets > [Your Project Name] > General > Frameworks, Libraries, and Embedded Content. https://github.com/forcedotcom/SalesforceMobileSDK-iOS/issues/2996#issuecomment-577032833

wmathurin commented 1 year ago

It should be working with more recent versions of the Mobile SDK since do what the work around above suggested (remove libCordova.a). Please re-open an issue if you are still having troubles.