Nativescript Pusher on iOS - javascript

I have successfully configured Pusher on Android which was straight forward.
on iOS, I configured and got a p8 key for APNS. In Pusher dashboard, I entered the key and the Team ID and ran the app on a physical iOS device, subscribed to "hello" interest.
The result of "UIApplication.sharedApplication.registeredForRemoteNotifications" is true which technically means that it had successfully registered for remote notifications but it's not applied on Pusher dashboard, it keeps saying "Waiting For Device".
Any help would be much appreciated. I'm running out of options here :/

Related

How to know if web app and executable app both are active at same time

I have a web app something like slack which is used for chatting and when user is offline then we send the notification that "you have a new message". The notification is html5 push notification, so it works when user has not opened web app.
I have recently created an executable app for people who chat all day. But problem is that when a new message is coming : notification coming from exe app and browser both.
So my question is : Can we find if web app and exe app both are active in one device? So that we can supress one of the notification. Does a pc have something like common id which we can access from javascript in browser and executable too?
Note :- I have information stored in server that web app is active and exe is active, i only need to find if they are from same device.
Thanks in advance. Please let me know your solution.
After a lot of hit and trial with different solutions - I found a solution.
I am embedding a http server in the exe app which let me communicate with web app. In the web app, i have added a web worker, which will ping the exe app server every 10 sec. If response received means exe app is active, then i turn off the notification on server by calling api. This will also make sure when the exe app is quitted, web worker wont get any response means exe is not active, so it activates the notification.
Now another issue was that - after installing the app, user didn't open the web app and he is getting two notification still. For overcoming this - i open the web app url when the exe app starts for the first time and it detects the status and turn off the browser notification. In the same process - i also save the browserId (a unique guid to identify the browser ) to the exe app and whenever exe app starts, i call the api to turn off the notification for these browserId.
Hope this helps someone.

Not Receiving Push Notification when app is killed on android device

I am currently working with RN0.44 , everything working fine on emulator , however on physical android device i am only able to receive push notification (remote) when app is running or at least it is in background, but when i kill the app i am unable to receive notifications.
I have also checked the settings for my app but no luck.
I am using this package react-native-notifications
I have also raised an issue at github
Any help is appreciated.

Device not registered in pushwoosh

I am using the pushwoosh to register the device via my trigger.io app.
This is my device registration code
I will trigger this code everytime my app starts.
According to the documentation, I need to define the code differently for IOS and Android, hence the 2 lines. (Not sure if it is correct).
However after I run the app and register a new user on IOS, the subscriber count in my pushwoosh did not seem to increase.
I have already uploaded the relevant apple certs and apns p12 files in pushwoosh.
IOS platform configuration page in pushwoosh
IOS platform device count did not increase after I start the app of a new user.
Does anyone know if there is any missing setup I need to do?
Issue seemed to have been resolved after I created a new application in pushwoosh.

Windows notifications (WP 8.1) - Unable to connect to WNS from client mobile app

From my windows mobile application, I want to implement the windows notifications.
My mobile application is based on :
Cordova (version 4.0.0)
Ionic Framework (version 1.0.1)
Cordova Windows (version 4.1.0)
Deploy on Windows Phone 8.1
To implement this feature, I'm using the cordova plugin "phonegap-push-plugin" (version 1.4.5).
When my mobile application is launched for the first time, I ask to my application to connect to the notification client platform. The goal is this notification client platform ask to WNS to return a new notification channel (URI form) to my application.
When I use the method "registration" from PushNotification class :
var push = PushNotification.init({
"windows": {}
});
push.on('registration', function(data) {
console.log("registration event");
document.getElementById("regId").innerHTML = data.registrationId;
console.log(JSON.stringify(data));
});
I get this error :
The notification client platform is unable to connect to the cloud
notification service
I thought the notification client platform is currently under maintenance. I found a file where are IP address ranges used by WNS. But when I ping differents IP address ranges and it works.
Is there anyone who already face this problem ? Or is there anyone who have an idea about how to fix it ?
Ok, I found the problem thanks to one of developper from github of pushplugin.
I had not checked on my Windows Phone that data service is disabled. I thought by default that data service was activated. So, I activated the data service from my Windows Phone and the push notification works again.
So, we must verify the data service is activated on your Windows Phone before to execute push notification method.
Check also your code error and verify what it means from microsoft notification API from here : PushNotificationChannelManager

How to debug push notifications for IOS?

I have setup ionic push for Android and IOS, the android version works great, but the IOS doesn't.
I have setup the provisioning and certificate files on IOS and they seem to be fine.
Also, the tokens get generated fine, and if i do a test with ionic push -s or CURL i can see the request going through with no errors that i can tell, just that the notifications don't show on the device.
I made the IOS package using the Phonegap Build service, not sure if that's an issue.
So, i guess my question is if there is a way for me to debug and figure out what went wrong.
Any ideas?
I also suffered a lot in push notification.
Finally i got some solution. it might be helpful for you
If u get device token from APNS server and notification send without any error but still you not getting notification in device then problem is in certificate.
Useful Links:
1) For Troubleshooting Push Notifications is here
2) Tutorial for generating generating certificate and send push notification is Here

Categories