I'm currently using laravel 7 and laravel-notification-channels/apn for iOS push notification. I also have a worker that handles sending notifications.
When I send a push notification to iOS it works fine initially but eventually, I got a 403 provider token expired. I can restart the worker to get the notification working again but how can I refresh a token without restarting a server? I have a production on Heroku and I don't think that would work in practice.
Thanks!
Related
I have a GSM PUSH panel and it happens that when user installs the app I record his id to send future notifications.
But after it uninstalls I continue with the ID of it saved in the database and whenever I run my routine, it sends the push to those users even without having the app installed.
The problem is that I already have thousands of id's and now it's taking more and more to send.
Is it possible to know who does not have the app installed anymore and put a flag in the database so it is no longer sent?
Example of JSon return:
{"multicast_id":5157270514039936452,"success":2,"failure":1,"canonical_ids":0,"results":[{"message_id":"0:1474029083357948%0e3f0485f9fd7acv"},{"error":"MismatchSenderId"},{"message_id":"0:1474029083356778%f17b55e1f9fd7erf"}]}
You have to implement it:(https://developers.google.com/cloud-messaging/registration)
The end user uninstalls the client app.
The app server sends a message to GCM connection server.
The GCM connection server sends the message to the GCM client on the device.
The GCM client on the device receives the message and detects that the client app has been uninstalled; the detection details depend on the platform on which the client app is running.
The GCM client on the device informs the GCM connection server that the client app was uninstalled.
The GCM connection server marks the registration token for deletion.
7. The app server sends a message to GCM.
8. The GCM returns a NotRegistered error message to the app server.
9. The app server should delete the registration token.
I have done the GCM Integration in iOS client, and i am able to push a notification from DHC - REST client. When i tried my registration token in my backend php it says Error: Not Registered.
Please help me on this, thanks in advance...
Try the following workarounds:
Make sure that the APNS token you're using to register with GCM is valid for the particular server.
Make sure that you are using the right iOS Development Provisioning Profile. Check if you're using the specific profile for your bundle name instead of a a generic one. To get push and background notifications working again:
Remove/Uninstall the application from the test device.
Perform 'clean' in XCode.
Perform 'build' in XCode.
Reinstall the app to the device.
You can check these related SO questions:
GCM IOS NotRegistered issue
GCM push fails with NotRegistered
gcm push notification: first success, then not registered in IOS
Hope it helps! :)
Have a good day! I implemented a push notification script on PHP for an iOS App. The push was delivered to the registered users of APP properly. But suddenly the push doesn't blasted to the devices in which my app installed. When I searched for the reason, I found that the SSL certificates for push notification has been expired.
Can anybody know to find the lifetime of SSL certificate of iOS app by using php or how can we find whether certificate is active or expired by using php
Thanks in advance!
You can check the lifetime of the certificates in your KeyChain, and on Apple's Developer portal.
I'm not sure which PHP library you're using for the push notifications, but chances are that it throws an exception or error message which you can catch / log.
I have a problem with IOS push notification. I am using php(Zend) as a provider. I have tested the notification in below scenarios:
1) Installed app in my iPhone and sends the device token to server and it is successfully stored in database. Then i have fired a notification, and i have received notification.
2) Then i have uninstalled the app from device and fired a notification. In this scenario APNS doesn't returned any error message. Feedback service also not gave any invalid tokens (Device has other apps which has push notification enabled).
3) Installed app again then send the notification. Now, The notification is successfully sent.
So my question is, why apns not returned invalid token when app is uninstalled from the device. Why feedback service not returned any invalid tokens?
Thanks in advance
When you uninstall an application, it does not get de-registered from the push server. So, this is normal behaviour. You won't get any invalid token error.
I have to send notification from server to android device. I developed application which got notification from server by using GCM (Google Cloud Messaging). But as I already have server then why to use GCM. I am not getting the purpose of using GCM. Can we send notification from server to android application without using GCM.
General Communication Pattern :
Device --> HTTPRequest -- >Server , Server -->HTTPResponse --> Device
But in this case, the device gets a response only when you send a request from your device to the server. Hence, whenever you need something new from your server you need to make a
request.
Using GCM, you do not need to make this request explicitly to your server. You'll automatically be notified when something new happens (depending on your implementation).
You are having server but GCM is totally different thing then your server.
GCM will monitor Your Application server that any changes made or not ??
And if anything created then it will send you notification without refresh or reload the Application.
and GCM will send you notification when your application is not working as well