Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

FYI: Resumed iOS 10 Notifications results in an error #1002

Closed
tusharsingh opened this issue Jun 19, 2016 · 15 comments
Closed

FYI: Resumed iOS 10 Notifications results in an error #1002

tusharsingh opened this issue Jun 19, 2016 · 15 comments

Comments

@tusharsingh
Copy link

Expected Behaviour

App opens and handles notification, which performs an action.

Actual Behaviour

App opens but handlers does not receive the notification or data.

Output shows a failure in push.js:43. notifications[i] is undefined.

Reproduce Scenario (including but not limited to)

  1. iOS 10 beta 1
  2. Open app (can be running through XCode so you can see output)
  3. Press home button
  4. Send a notification
  5. Press the notification
  6. App opens, view the output on XCode

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 10 beta 1 on iPhone 6.

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Cordova CLI version and cordova platform version

CLI version: 6.1.1
cordova ios 4.1.1

Plugin version

1.7.1

Sample Push Data Payload

{ "uri": "/test" }

Sample Code that illustrates the problem

This all works on iOS 9 using the standard registration notification registration code.

Logs taken while reproducing problem

2016-06-19 12:07:39.558293 App Name[4973:890464] Push Plugin handleActionWithIdentifier com.apple.UNNotificationDefaultActionIdentifier
2016-06-19 12:07:39.558670 App Name[4973:890464] Push Plugin userInfo {
aps = {
alert = "Check this out!";
badge = "-1";
};
callback = "com.apple.UNNotificationDefaultActionIdentifier";
notId = 1411111111111129336;
uri = "/test";
}
2016-06-19 12:07:39.559533 App Name[4973:890464] Push Plugin notId 1411111111111129336
2016-06-19 12:07:39.562717 App Name[4973:890464] Notification received
2016-06-19 12:07:39.562815 App Name[4973:890464] Push Plugin key: alert
2016-06-19 12:07:39.562898 App Name[4973:890464] Push Plugin key: badge
2016-06-19 12:07:39.897422 App Name[4973:890464] Error in Success callbackId: PushNotification1017597311 : TypeError: undefined is not an object (evaluating 'namespaces[i]')
2016-06-19 12:07:40.127061 App Name[4973:890464] active
2016-06-19 12:07:40.127163 App Name[4973:890464] PushPlugin skip clear badge

@tusharsingh tusharsingh changed the title FYI: Resumed iOS 10 Notifications result in an error FYI: Resumed iOS 10 Notifications results in an error Jun 19, 2016
@macdonst macdonst added the ios label Jun 20, 2016
@macdonst
Copy link
Member

@tusharsingh did you set callback = "com.apple.UNNotificationDefaultActionIdentifier"; in the push payload or did iOS 10 do that?

@tusharsingh
Copy link
Author

I did not set that in the payload. iOS 10 appears to do that with the callback id and then adds it into the dict.

@macdonst macdonst added the bug label Jun 20, 2016
@macdonst
Copy link
Member

@tusharsingh right, that's what I was worried about. I'm going to have to upgrade one of my devices to the beta this week.

@drastick
Copy link

+1

@macdonst
Copy link
Member

@tusharsingh I'm pretty sure I can fix this in short order. I've been spending the past two days downloading Xcode8/iOS10 to put on a device. With a little bit of luck this should be done by Monday with a 1.7.2 release out to support stuff.

@macdonst
Copy link
Member

@tusharsingh @drastick I just pushed up what I believe to be the fix for this issue. Can you install the plugin from master:

cordova plugin add https://github.com/phonegap/phonegap-plugin-push

and see if it is resolved for you as well? If I get a positive response from you I'll get a 1.7.2 out.

@drastick
Copy link

@macdonst I just did some preliminary tests and it seems to be working. Thanks!

@macdonst
Copy link
Member

@drastick okay, I have to go BBQ for my family but will release an update this weekend.

@tusharsingh
Copy link
Author

@macdonst Working as well for foreground, resume/background, and cold start.

Thank you!

@macdonst
Copy link
Member

kk, released 1.7.2 with this fix.

@thsantac
Copy link

thsantac commented Sep 26, 2016

Hi,

Sorry but with iOS 10.0.1 and plug-in 1.8.2 I still have the issue only when app is in background. Notification is received by iOS but when I slide it, the app comes in foreground, and nothing happens. I have put an alert just after the "push.on('notification', function(data) {" and I never see it.

It works like a charm when app is killed before receiving the push.

Any idea?

@Bart-Holland
Copy link

I curious how you can recieve push notifications in iOS 10, I only recieve them in debug modus.

@thsantac
Copy link

thsantac commented Oct 4, 2016

Sorry to come back but I would like to solve this issue if possible. Should I downgrade to 1.7.2 ?

Thanks for helping me.

@manojrejinthala
Copy link

@macdonst i am using 1.8.4 version of push plugin

However, in my iPhone 5 version 10.0.2, push notification doesn't work any more when the app is minimized or in background but it works fine when the device is from cold start

@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

6 participants