Closed DoctorsInTech closed 4 years ago
I can’t reproduce, can you provide a sample app?
I am facing the same problem.
It is very difficult to recreate. Yesterday it just started working again without me actually changing anything. And then now today, the event has stopped firing.
I don't know if it is something to do with caching of files, but the firing of the event seems to be quite hit and miss, at least when ran locally on a device from XCode.
I've tested multiple times, with different apps, during different days and in different devices and I can't reproduce on any of them. Make sure your device is connected to internet, and not behind some proxy that could be blocking the connection to APNS.
Okay, it's good to know you can't reproduce it, I wonder if it has something to do with my provisioning profile. Though only seems to happen when run locally. I'll let you know if I find the problem. Thanks.
I had the same issue, restarting my iPhone fixed it, weird I know :D
I have the same issue, and currently cannot resolve it. onRegistration listener is never triggered. It was working, but then no trigger happen. Did nothing previously. Tried upgrade capacitor from 2.1.0 to 2.2.1, but still nothing happen.
Any solution?
I am experiencing the same issue. It was working for a while, then all of a sudden it stopped working. Is there perhaps some kind of flooding protection from Apple?
I remember experiencing this with another app earlier in this issue.
I also had the problem registering push notification/getting the token, I tried many options discussed on the internet and none seemed to work.
Finally, based on the below text from Apple site (https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html) I inserted a valid SIM card with active data plan (there was either none used or not active SIM before because this is my development/test iPhone device) and got the registration token successfully.
If a cellular or Wi-Fi connection is not available, neither the application:didRegisterForRemoteNotificationsWithDeviceToken: method nor the application:didFailToRegisterForRemoteNotificationsWithError: method is called. For Wi-Fi connections, this sometimes occurs when the device cannot connect with APNs over the configured port. If this happens, the user can move to another Wi-Fi network that isn’t blocking the required port. On devices with a cellular radio, the user can also wait until the cellular data service becomes available.
Please also see No Delegate Callbacks section at https://developer.apple.com/library/archive/technotes/tn2265/_index.html
After that I removed SIM card and everything still works even though I'm connected to WiFi only. I'm getting registration token and push notification messages.
I am using a valid phone, valid SIM card with an active data plan but still experiencing this. As I said earlier, it was working for a while. I have read through this StackOverflow issue and tried every answer with no luck. I still feel like there is some kind of throttling going on. Yesterday, when I waited a couple of hours, it suddenly worked again, but only once.
Not sure if this might be related but the App seems to change the state after the permission request.
⚡️ To Native -> PushNotifications requestPermission 115047851
APP INACTIVE
⚡️ [log] - onAppStateChange {"isActive":false}
⚡️ TO JS {"granted":true}
⚡️ To Native -> PushNotifications register 115047860
APP ACTIVE
⚡️ [log] - onAppStateChange {"isActive":true}
EDIT:
Now all of a sudden I received 4 simultaneous registration
events. This appears to be an issue with APNS and not Capacitor. We should probably close this issue but inform about this in the documents section.
This appears to be an issue with APNS and not Capacitor. We should probably close this issue but inform about this in the documents section.
Based on my experience, there have been always much more problems with push notification development/testing on iOS devices compared to Android. It usually works out of the box for the latter and there are often problems with the former :(
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report
After updating capacitor to latest (2.1.2) the registration event no longer fires on device registration.
Capacitor Version
npx cap doctor
output:Affected Platform(s)
Occuring on iOS platform.
Current Behavior
Promise from requestPermission() is fired with { "granted": true } in result param. However the registration event is never fired.
Expected Behavior
Registration event should fire in order for me to register device with back end (Azure Notification Hub)
Sample Code or Sample Application Repo
Registration Code:
Output in XCode console:
Other Technical Details
npm --version
output: npm 6.4.1node --version
output: v10.15.0pod --version
output (iOS issues only): 1.9.1