Skip to content
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

App crashes on notification click #34

Closed
clem983 opened this issue May 1, 2017 · 7 comments
Closed

App crashes on notification click #34

clem983 opened this issue May 1, 2017 · 7 comments

Comments

@clem983
Copy link

clem983 commented May 1, 2017

Hi,

I'm using OneSignal and your plugin for my app. All is working very well, except when I click on a received notification. In this case, the app is always crashing. Do you know this problem ?

Thanks a lot.

@chmiiller
Copy link
Collaborator

chmiiller commented May 2, 2017

Hi everyone,
I'm also having this issue + if the app is on foreground (opened) and has received a notification it also crashes. Just to be clear, this is happening on iOS (10.2.1).
I'm testing with release 1.6.0 and Titanium SDK 6.0.2.GA/6.0.3.GA/6.0.4.GA
Here are errors I get when testing (when the notification arrives):

-[TiApp application:didReceiveRemoteNotification:]: unrecognized selector sent to instance 0x1741f4100

[ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'. Reason: -[TiApp application:didReceiveRemoteNotification:]: unrecognized selector sent to instance 0x1741f4100

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TiApp application:didReceiveRemoteNotification:]: unrecognized selector sent to instance 0x1741f4100'

In my tiapp.xml (info.plist) I have this:

<key>UIBackgroundModes</key>    
<array>
    <string>remote-notification</string>
    <string>fetch</string>
</array>

And of course my <property name="OneSignal_AppID" type="string">APP_ID</property>
Is that enough or is something else I have to add on it?

Does it help? I hope so, gonna try and test a bit more and let you guys know in case of progress.

Thanks!

@jvandijk
Copy link
Collaborator

jvandijk commented May 2, 2017

I'm not using any of the background modes, 6.0.3.GA and iOS 10.3. I'm able to click the notification properly resulting in an app open action.

@chmiiller
Copy link
Collaborator

YEAY! That was the problem @jvandijk ! If I remove this UIBackgroundModes from my tiapp.xml it just works! Awesome 🎉
The only problem is that I ain't receiving any additionalData when the app is completely closed as in #7 =/
So @clem983 , removing UIBackgroundModes from your tiapp.xml should fix your problem, then this issue could be closed

@clem983
Copy link
Author

clem983 commented May 3, 2017

Hi,
I didn't give you enough details. In my case, it's with Android (several versions) and 6.02 / 6.03 GA. In tiapp.xml I don't have UIBackgroundModes.
The only error I can see is the alert "The app has closed".

Is there an other solution ? :/

Thanks a lot :)

@chmiiller
Copy link
Collaborator

Well, then I'll recommend you to debug it with ADB logcat from your phone and post here more details of your error.

@grazianogrespan
Copy link

Hi all, thanks for the module! It's awesome!
As @clem983 said, if you click the notification when the app is killed, it causes a crash.
On Android, SDK 6.0.4GA.
This is the log from ADB, hope it is useful...

@jvandijk
Copy link
Collaborator

jvandijk commented Aug 9, 2017

#38 changes the way how the module is initialised. This issue should be gone now. Reopen if this is not the case.

@jvandijk jvandijk closed this as completed Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants