-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS App crashes after Resume from ScreenLock #202
Comments
Sorry for reopening this, but the error didn't go away by updating to phonegap 6.3.0. i have figured out, that the error does not appear when Branch.setIdentity() is commented out. As soon as .setIdentity is called one time at startup, the app crashes when coming back from background or screen lock. Only happening on iOS. |
Some more information: As I said, if .setIdentity is uncommented, it does not crash. Although if call Branch.setIdentity(2222222) (EDIT: from the debugging console), the identity is set correctly (as seen in dashboard), but if the app is reactivated from background then, it crashes. |
Thanks for the extra info on this @malua. I'll have @renesansz take a look soon. |
thanks for the info @malua, will look into this. |
@malua , may I know what iOS version are you using? I've tested it on an actual device (iOS 9.3.5) and somehow the testbed app didn't crash.
Also, can you provide some sample codes? Thanks |
I have tested it on iOS 9.3.5 and 7.1.2. It's happening on both. I am also not sure about the hooks working on PGB. could it be the PGB ignores a hook, and the app crashes because of this ? but it compiles fine, and all the features are working. As for the code samples. I just call
I added the timeout due to this : Cordova Docs Resume Event and then I set the identity when loading a profile like this:
If I uncomment the part about Branch.setIdentity() the app never crashes. and as i said if i call it manually from the debugging console in safari, the identity is set, but the app crashes after the next screenlock or if it was in the background. EDIT: Could that be somehow related? https://stackoverflow.com/questions/39307116/application-with-branch-deep-linking-shows-uialertcontroller-warning-on-reopenin |
Oh no, I am getting a really bad feeling: Maybe it's not possible to use Branch with PhoneGap Build at the moment? |
Hmm - thanks for linking to that PG error. I was unaware people were struggling with the entitlements that much. However, that's a very different error than the one you're describing and I'll address that in a separate issue I just created. I know this because at no point does the library read from the entitlements file. #207 Taking a look at your issue now. |
I'm pretty sure this is related to an issue (BranchMetrics/ios-branch-deep-linking-attribution#424) on iOS that we just discovered, where it was possible for setIdentity to be executed before init was finished BranchMetrics/ios-branch-deep-linking-attribution#428. I bet this causes some crash on Cordova. We'll get this merged in ASAP. |
Is this merged already? I tried to add the plugin via git. and specified the branch update-ios-lib. unfortunately it is still crashing. i moved our build process to local cli on osx. now i get better crash logs and now you can see its directly got to do with the setUserIdentity:
|
Hey @malua - I've merged it in this morning as part of the 2.2.0 update. Please update and let me know if you still observe the issue. Thanks! |
The update did not fix the issue, because the problem was a different one. I was calling .setIdentity with a integer, not a string. this works on android, but let's the app crash on ios due to this [__NSCFNumber isEqualToString:] in the branch ios sdk. maybe you can change that or make it more visible, that setIdentity can only be called with String. Thank you! |
When I lock the screen with the running app in foreground and then unlock again, the app crashes after 2 to 3 seconds. (this is not happening on android)
Its definitly branch, as it works if i remove the from the config.xml. do you have any idea what that could be?
What should happen if Branch.initSession() is called twice? Could that be the problem?
this is the log from safari: i doesn't say very much to me, also because you can see no code hints or anything else. but maybe you can extract some information from that.
crash log.txt
thanks for your support!
The text was updated successfully, but these errors were encountered: