Phonegap build pushplugin with iOS - ios

I'am very new to phonegap and building apps
Im using the sample code from pushplugin, and the notifications on my android work, but I am not even getting registered on my ipod, in the tokenHandler function it is supposed to log the response in the console and nothing is showing up, it logs fine in the android function.
All that I have done so far that involves push notifications is create the push notification certificate in the apple developer center, and it says that push notifications are enabled for the development version of the app.
For the android notifications I had to do a lot more to get it to work so I feel like Im missing a step
Am I supposed to do something with that certificate? I read somewhere that you are supposed to install the certificate on the server that is going to be sending the messages? If that is true how do I do that? The webserver that will be sending it is an ubuntu command line only server with apache2
And in the pushplugin code I had to enter the senderId for the android side, is there something similar Im supposed to enter in the code on the ios side.
When I first opened the app on my ipod, it said that this app wants to send me push notifications and I said OK, but still i am not getting any register response
Thanks for any help, I was doing so good by myself until I started on the apple app.

I figured it out, it was because the ondeviceready function was not firing with the ios device, it is with the android, i made a setTimeout function in the onload jquery function to register it a few seconds later and its working great now
Don't know if there is a better way, but Im happy for now

Related

Notifications not working on Whitelabel iOS Rocket.chat app

So I am whitelabeling the Rocket.chat app for iOS. I have already done this for Android and it is working very well. The issue I'm having is that the app works on the simulator, but it does not receive any notifications. I have followed these instructions to no avail. It seems as if the app is not able to communicate with Firebase. Additionally, when I first launch the app after installing, it asks if I want to enable notifications, so the app itself is working. I'm really not sure what to try next. Thank you for your help. If you need any additional information, just let me know.
So the simulator cannot receive push notifications. Seems strange, but that was the problem.

react-native-push-notification remote doesn't show when I test with real ios device with xcode

I'm using react-native-push-notification.
I'm trying to test push notifications, if I build app and upload it to testflight it shows remote notifications just fine, but when I do it with xcode build on a real device it doesn't react at all (I'm getting onRegister call and notification token though). This problem is only on IOS, android getting notifications in production and development. Can't google anything related so probably I'm missing something.
P.S. I'm using backend to send notifications through firebase
you have to go in capaibility in xcode and active PushNotification first
for more info see this
hope you have followed all the steps to get the APNS certificate and attached that to your xcode, before the build, if not please do so.
Also, in addition you need to have .pem file to add to your Firebase to make your ios app enable to send and receive push.

iOS + Xcode + Swift 4.2 Send messages to APNs from an iOS Device

I've been searching everywhere (and experimenting) for the past week but i can't seem to find anything to point me in the right direction. I have the local version (https://github.com/onmyway133/PushNotifications/releases) running on my Mac and i am receiving notifications on my iPhone just fine (p8 and p12) but what i really need is to be able to send a push notification message from an iOS device.
It has to be possible since it is a simple HTTP/2 JSON outcall. I went through a lot of different libraries and samples for server-side implementation but can't find anything for Swift and iOS (i failed at compiling what i could find so far).
Any and all help and suggestions is greatly appreciated.
Try NWPusher, where you can send push notifications not only from Mac OS X and from iOS as well.
https://github.com/noodlewerk/NWPusher
Push from iOS
The ultimate experience is of course pushing from an iPhone to an iPhone, directly. This can be done with the Pusher iOS app. Before you run the PusherTouch target, make sure to include the certificate, private key, and device token inside the app. Take the PKCS12 file that you exported earlier and include it in the PusherTouch bundle. Then go to NWAppDelegate.m in the Touch folder and configure pkcs12FileName, pkcs12Password, and deviceToken. Now run the PusherTouch target:
If everything is set up correctly, you only need to Connect and Push. Then you should receive the Testing.. push message on the device.

Testing Amazon SNS for iOS using the Mobile Hub but can't get it to work

Per the title, I'm trying to get AWS SNS push notification to work on iOS device. For testing purpose I wanted try the Mobile Hub (https://console.aws.amazon.com/mobilehub) and work my way on top of the sample app that's given.
I just can't seem to make it work. I know it's difficult to ask for help when it involves a multi layered instructions, but I've spent all weekend wrestling this issue, and just couldn't seem to figure it out.
In AppDelegate, didReceiveRemoteNotification call should receive something when I trigger an SNS within Amazon SNS Mobile Console after selecting a Topic. But this protocol is not being called.
In terms of Provisioning Profile, I've created both Development & Distribution. Tested with both.
In terms of certificates I have tried with both Apple Push Notification service SSL (Sandbox) and Apple Push Notification service SSL (Sandbox & Production). It's obvious you have to select the latter since with the former, the notification permission alert doesn't even show when you install the app. Only does it show when you've installed it with the latter.
I made sure the bundle IDs match.
I've turned on all my notifications on my iphone 6s.
On console I see this success message:
2016-03-30 20:57:57.103 MySampleApp[284:47861] AWSiOSSDKv2 [Info] AWSPushManager.m line:186 | -[AWSPushManager interceptApplication:didRegisterForRemoteNotificationsWithDeviceToken:] | The device token: 435d5se354s38s9ddge2edcs2a3601e18ss9c83e47s629164ebced21s16abb39974sg3
"didFailToRegisterForRemoteNotificationsWithError" never gets called.
"didRegisterForRemoteNotificationsWithDeviceToken" successfully gets called.
I also get this success message on my console:
2016-03-30 21:34:16.635 MySampleApp[321:57551] AWSiOSSDKv2 [Info] PushNotificationViewController.m line:112 |
-[PushNotificationViewController topicDidSubscribe:] | Successfully subscribed to a topic: AWSPushTopic: 0x14c6da770
I'm absolutely lost. Please let me know if there is more info for me to post to solve this issue.
Update: Rohan Dubal, thanks for the comment. Here are the following things you asked me for.
Yes, I have always went from "My Sample App" navigationbar view -> "Push Notifications" row -> "Push Notifications" navigation bar view -> click Demo Push Notifications on the bottom -> the toggle is on (green) and the "topic" line is checkmarked and I have sent the APNS to that referring Topic.
Yes I've tried minimizing and also closing the app as well. The top bar notification or any notification doesn't show at all.
Thanks for your feedback. Please do suggest any other tests I can run.
Also, I thought that maybe it has to do w/ my iphone 6s so i tried it w/ iphone 5s and it still doesn't work.
iphone 6s is ios9.2 and iphone 5s is ios 8.3.
Well, this sounds similar to the problem that I was just having. Mobile Hub only seems to let you setup Production APNS and not Development ones. When I debug the app with XCODE I'd need to use the sandbox APNS, so I did the following:
Create an SNS Application of type Apple Development (APNS_SANDBOX)
Use the .p12 from my Development Certificate in the App ID
Started my App and recorded the device token that didRegisterForRemoteNotificationsWithDeviceToken gave me
Minimised my App (otherwise notifications don't appear)
in SNS console I registered an Endpoint using the device token
Used the Publish to this Endpoint button in SNS console to send a message ('Hello World', obviously)
Saw notification
Did engineers victory dance
Hopefully that helps you. The key to this for me was realising that I'd need to create another SNS queue. TBH I'm not seeing the benefit of the Mobile Hub.

Phonegap PushPlugin can't receive notifications ios

I am developing a Phonegap application for both Android and iOS and would like to enable push notifications for both.
The app is using the Phonegap plugin PushPlugin which sets it to receive notification for both Android and iOS.
I am having issue with the iOS version of the app. When running it, I get the screen asking if I want to allow the app to receive notifications, I select yes then I receive a device token which is then used on the server side to send the notification to the selected device. This was a good indication that the Phonegap plugin was working.
Server side, I am using AmazonSNS to send the notifications. (Java code of this can be downloaded here.)
With AmazonSNS I need to pass in:
certificate (created in the online iOS development center)
private key (exported from the certificate)
device token (from PushPlugin)
to send the notification.
I followed this detailed tutorial on how to get the app id, certificate, private key and provisioning profile all set up.
The problem is, after sending the notification, not only does the app not receive the notification, but sending the notification doesn't error or give me any feedback as to what might have went wrong.
I'll also point out, the Android version of the app is successfully receiving notifications using the same java code.
Any advice on what the issue here might be would be great.
Thanks
I managed to work out what the problem was.
In my server-side plugin, I was trying to connect to APNS directly, but what I should of been doing was connecting to APNS_SANDBOX.

Resources