phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

App crashes after launch with 6.2.0 #933

Closed kaynz closed 8 years ago

kaynz commented 8 years ago

Reproduce Scenario (including but not limited to)

Update to Cordova 6.2.0 Update to phonegap-plugin-push 1.6.4.

Steps to Reproduce

Start application

Platform and Version

iOS 9.3.1, iOS 9.3.2

Cordova CLI version and cordova platform version

cordova --version:  6.2.0
cordova platform version android: 4.1.1

Logs taken while reproducing problem

[NSTaggedPointerString objectForKey:]: unrecognized selector sent to instance 0xa000000000000301 2016-05-27 12:27:47.075 MyApp[3274:3630108] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString objectForKey:]: unrecognized selector sent to instance 0xa000000000000301' * First throw call stack: (0x181bf2e38 0x181257f80 0x181bf9ccc 0x181bf6c74 0x181af4d1c 0x1000f3e2c 0x1005a9a3c 0x1005aa8b4 0x1000f3cf8 0x100102788 0x100101884 0x100102688 0x1005a9a7c 0x1005a9a3c 0x1005af4e4 0x181ba8dd8 0x181ba6c40 0x181ad0d10 0x1833b8088 0x186da5f70 0x10004a4f8 0x18166e8b8) libc++abi.dylib: terminating with uncaught exception of type NSException

macdonst commented 8 years ago

@kaynz some code would really help in order to reproduce.

kaynz commented 8 years ago

@macdonst my code is pretty simple: https://paste.xinu.at/dOCV/js @d3v1an Could you post your logcat output?

macdonst commented 8 years ago

@kaynz that's not valid JSON you are passing to the init method. It should be:

{
          'android': {'senderID': XYZ, 'iconColor': '#9dd442', 'icon': 'ic_stat_notification'},
          'ios': {'alert': true, 'badge': true, 'sound': true}
}

Try that and let me know.

@d3v1an yeah, need more info for sure. A logcat of the crash would be super helpful. I'm betting it is a diferent issue than the one @kaynz opened though.

kaynz commented 8 years ago

Okay, my JSON looks like this now:

_push = PushNotification.init(
          {
            "android": {
              "senderID": Constants.GCM_OPTIONS.senderID,
              "iconColor": '#9dd442',
              "icon": 'ic_stat_notification'
            },
            "ios": {
              "alert": true,
              "badge": true,
              "sound": true
            }
          }
        );

Same error though. The error appears right after 2016-05-30 14:49:39.603 MyApp[3832:4287285] PushPlugin skip clear badge

macdonst commented 8 years ago

Can you post the full logs?

kaynz commented 8 years ago

Sure: https://paste.xinu.at/MvnMir/js

macdonst commented 8 years ago

@kaynz dang it, I can't reproduce. What happens if you comment out the init method in JS? Does the error still occur?

kaynz commented 8 years ago

@macdonst Yea, it still occurs w/o the init method.

macdonst commented 8 years ago

@kaynz so if it occurs without the init method of the push plugin being called then it doesn't seem to be a problem with the push plugin. You should try removing other plugins or commenting out their code to narrow it down.

Going to close this issue but feel free to re-open if you can pin point a problem with the plugin.

kaynz commented 8 years ago

@d3v1an any news? im still up with this problem, my cordova issue got closed, too

shazron commented 8 years ago

This error occurs because an NSDictionary is expected, but a NSString was encountered. The only way to find out which code causes this is by re-adding plugins used one by one. See: https://issues.apache.org/jira/browse/CB-11327?focusedCommentId=15317061&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15317061

The crash could be in:

  1. the plugin code
  2. the cordova-ios platform code
lock[bot] commented 6 years ago

This thread has been automatically locked.