0

I am trying to extend my app with a push service. Looking through the web I found several ionic examples, yet have not been able to wrap my head around it.

Here's my goal:

My server should send a push notification about every 3 hours to each individual user to update them on their individual parameters.

Hence, I need a server solution that targets the package to each individual. On the client side I thought of using

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

I already obtained apple push certificates but am not sure how to use them... Any help is welcome!

El Dude
  • 5,328
  • 11
  • 54
  • 101

3 Answers3

1

$cordovaPushV5 is the latest version & works perfectly. Get your SENDER_ID by registering here

Muhammad Faizan Uddin
  • 1,339
  • 12
  • 29
1

As per your requirement analysis I would recommend to use Ionic's push from Ionic Cloud API with matchless compatibility across all platform you can find you more about it here

Ionic Push Notification Docs

More over it provides online portal for certificate configuration area minimal onboard configuration required extending the functionality it also provides online portal for sending out push to your devices along with Restful API services for server utilization.

For Tokens : Ionic will be responsible of generating token all you need to do is save that token on your localdb for future reference to send push notification to targeted device. Tokens will be generated one time only upon first run of the application. (Token needs to be renewed upon New install / Update)

  • Thanks Syed, but I am affraid this this is too high level. I need to automate my push notifications so that they are generated by an interface that connects my user DB and the push engine. I do not find an API for the `Ionic Push` that would automate that? – El Dude Nov 20 '16 at 21:47
  • No API was for Ionic Push 1, Ionic Push 2 has the RESTful API you mentioned. Looking into it. – El Dude Nov 22 '16 at 04:28
  • Hi El kindly refer to this link https://docs.ionic.io/services/push/#sending-pushes – Syed Atir Mohiuddin Nov 23 '16 at 13:29
0

At first Install following Plugin under your project

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

Download following code from here: https://drive.google.com/open?id=0B_-b-DfCLwKdREkwZFdYVEhYWXM

Then merge code in your app.js and after that run your application in iphone and check in console device if you are getting token or not, if device token is showing then move on to next step.

Then you can store device token in database when user login or register.

Then enter your [.pem] file location and pass phrase in [db.class.php]

Then enter device token in [sendIphonenotification.php] file

Then execute [sendIphonenotification.php] file and check your iphone you will get a notification.

Also, if you face any issue in generating .pem file and passphrase then you can follow this link: Generate .pem file Used to setup Apple PUSH Notification

Community
  • 1
  • 1
Krish
  • 379
  • 2
  • 8