OneSignal ios cordova 应用在点击通知时退出

OneSignal ios cordova app is quit when tap on notification

2017-01-25 12:48:02.057770 onesignaldemo[1009:314358] [DEBUG] [WL_PUSH] -[Push processRemotePushNotification:] in Push.m:426 :: Push: didReceive Remote notification 2017-01-25 12:48:03.065772 onesignaldemo[1009:314358] [FATAL] [WORKLIGHT] Uncaught Exception: * -[__NSSingleObjectArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0] 2017-01-25 12:48:03.093979 onesignaldemo[1009:314358] Terminating app due to uncaught exception 'NSRangeException', reason: ' -[__NSSingleObjectArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]' * First throw call stack: (0x190eed1b8 0x18f92455c 0x190ede420 0x10011d514 0x10011cfb8 0x1919ea46c 0x190e9b1d8 0x190e9aeec 0x190e9a7a8 0x190e983a4 0x190dc62b8 0x19287a198 0x197041510 0x197254c3c 0x19725885c 0x190ef3150 0x190de5eac 0x190dea95c 0x196a8bdd4 0x190ef1070 0x190dea80c 0x196abc92c 0x195bea254 0x19613dba0 0x195519044 0x19551862c 0x195518a6c 0x1955185c8 0x19551862c 0x1955185c8 0x19551862c 0x195512328 0x1953e4a68 0x194e1e770 0x195101f50 0x19663edec 0x19663fc0c 0x196aca61c 0x197256dd4 0x10039f5c0 0x191a01048 0x190e9ab5c 0x190e9a434 0x190e980a4 0x190dc62b8 0x19287a198 0x196e0d7fc 0x196e08534 0x1000183d0 0x18fda95b8) libc++abi.dylib: terminating with uncaught exception of type NSException Blockquote

这是我在应用程序中获取的有效负载

cordova.require('cordova/exec').nativeCallback('OneSignalPush998202862',1,
  {
    "shown" : true,
    "payload" : {
      "body" : "wwww",
      "sound" : "default",
      "notificationID" : "93d30e95-8af8-4e47-a50d-e09af9fd9498",
      "rawPayload" : {
        "aps" : {
          "alert" : "wwww",
          "sound" : "default"
        },
        "custom" : {
          "a" : {
            "foo" : "bar"
          },
          "i" : "93d30e95-8af8-4e47-a50d-e09af9fd9498"
        }
      },
      "additionalData" : {
        "foo" : "bar"
      }
    },
    "isAppInFocus" : true,
    "displayType" : 2
  }
,1)

Worklight 版本为 7.1

此 CDVCommandDelegateImpl.m

代码出错
- (void)evalJsHelper2:(NSString*)js
{
    CDV_EXEC_LOG(@"Exec: evalling: %@", [js substringToIndex:MIN([js length], 160)]);
    NSString* commandsJSON = [_viewController.webView stringByEvaluatingJavaScriptFromString:js];
    if ([commandsJSON length] > 0) {
        CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by chaining.");
    }

    [_commandQueue enqueueCommandBatch:commandsJSON];
    [_commandQueue executePending];
}

复制错误

推送通知工作正常。
应用能够接收通知

应用程序处于非活动状态:如果我点击通知,应用程序将打开并在应用程序内显示通知警报,然后突然退出。

应用处于活动状态:通知会自动显示在应用中,应用会卡在那里。

I could integrate Onesignal in my ios app. The issue was in config.xml I commented the push related tags in config.xml.