#1 2016-07-18 10:26:39

sabinocivita
Member
Registered: 2016-07-14
Posts: 3

Push Notifications Android & IOS

Hello everybody,

how to implement in the app a push notifications service ?
Simply as possible..........

Thank you in advance for your help


sabinocivita

Offline

#2 2016-07-18 11:54:46

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello Sabino,

Thanks for your interest in App Builder. Are you take a look at the "Pusher" and the "PushPlugin" app samples? Maybe one of them can be useful to your purpose, so try it and post here if you have some further question.

Online

#3 2016-07-18 16:48:58

sabinocivita
Member
Registered: 2016-07-14
Posts: 3

Re: Push Notifications Android & IOS

Hello David, just to be sure, I explain quicky what I done.
I made a simple app using iframes control to display my magazine site.
My site is done in WordPress.
What I want to do is to send a push notification to all user that will install app when a new post is present.

Is it simply to do ?

Offline

#4 2016-07-18 17:19:07

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello Sabino,

Certainly we can do it. In fact the "PushPlugin" app sample demonstrates how to do it. As you can see in that sample we need to use certain Apache Cordova's plugin, deal with a little of pure Javascript (just an app's Javascript function) and finally an account in the Google Cloud Service API.

We can send the push notifications using some server script (like the "PushPlugin" does) or just by using the Google service console. Basically we "push" a message and then anyone who have the application installed receive such message as a notification which the users can click in order to open our application.

The problem is, Sabino, you already can found this ready in the "PushPlugin" app sample... so I am not sure how to help you... since you can simply copy the appropiate code to your application, etc. So if you have any further question don't hesitate to post it here.

Online

#5 2016-07-20 18:49:30

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello to all,

I update App Builder right now in order to include certain changes made over the "PushPlugin" app sample. Now, instead of use one PHP script for both, the registration process and the send message process, we use two separates PHP scripts, and also an HTML file with a form, which we can fill to send a push notification easily.

On the other hand, remember this application uses certain Google API authorization and credentials made specifically for the sample, so, if you want to use the "Push plugin" in your application, you must get your own Google API authorization and credentials. If anyone need some help about this question post here and I will try to help.

If anyone want to try, folowing the below link you can download the "PushPlugin" APK file, then you can install it in your Android device.

PushPlugin.zip

Once you do that you can already request a push notification (as a sample) from the application, or, even better, using the below HTML form:

http://www.davidesperalta.com/Humm/Site … dpush.html

Attention! I have the sample application installed, then any message you send arrive also to me and to other possible users too!

Online

#6 2016-07-21 15:05:21

sabinocivita
Member
Registered: 2016-07-14
Posts: 3

Re: Push Notifications Android & IOS

Hello David,

thank you so much for your deep and accurate help ! You solved my issue and now all works great !

Great Job !!!!!!!!!!!!!

Sabino

PS: Compliments for your APPBuilder !!! No APPBuilder No Party !!!!!!!

Offline

#7 2016-07-21 15:13:34

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello Sabino,

sabinocivita wrote:

Hello David,

thank you so much for your deep and accurate help ! You solved my issue and now all works great !

Great Job !!!!!!!!!!!!!

Sabino

PS: Compliments for your APPBuilder !!! No APPBuilder No Party !!!!!!!

Thanks very much! I am happy to help and certainly Push notifications appear a very good addition to our applications. I know you have lot of works yet in the application, then let me know if I can help in something.

Thanks again for your kindly words Sabino.

Online

#8 2017-01-13 21:17:01

Tonym
Member
Registered: 2016-12-03
Posts: 26

Re: Push Notifications Android & IOS

Fantastic post.
I have tried this but i am getting

"Registration ID send failed" what am i missing here.

Offline

#9 2017-01-14 10:06:46

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello to all,

Tonym wrote:

Registration ID send failed

If the above exactly the error message that you get? Or the message include some more information?

Online

#10 2017-01-14 13:39:02

Tonym
Member
Registered: 2016-12-03
Posts: 26

Re: Push Notifications Android & IOS

Hi david
thats all i get.

I think it has to do with the register.php, line 18

if (issset($_Post['RegisterID']))

Last edited by Tonym (2017-01-14 13:51:49)

Offline

#11 2017-01-14 15:42:49

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello,

Are you trying with the application sample without modification or you are trying to use your own server scripts and Google credentials? I asume you build the sample with Apache Cordova and you are trying in an Android device (for example), it's this correct?

Online

#12 2017-01-14 16:32:17

Tonym
Member
Registered: 2016-12-03
Posts: 26

Re: Push Notifications Android & IOS

Hi
I used the sample, and have done all the modifications in the phps; Api key and sender ID, RegisterPush and SendRegisterID functions and built with cordova.

But  i think my problem is with the POST in register.php.

Do I need to have a file on my server called RegisterID and  what type of file should it be.

Last edited by Tonym (2017-01-14 16:35:48)

Offline

#13 2017-01-14 16:45:06

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello,

I am triying right now with the PushPlugin sample and they works as expected. Why do you think that the problem can be in the "register.php" script? Can you provide me with a little application sample in order to take a look?

Online

#14 2017-01-14 16:58:14

Tonym
Member
Registered: 2016-12-03
Posts: 26

Re: Push Notifications Android & IOS

Ok

Offline

#15 2017-01-14 16:58:51

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello,

Tonym wrote:

Ok

Ok for what? smile

Online

#16 2017-01-14 17:01:01

Tonym
Member
Registered: 2016-12-03
Posts: 26

Re: Push Notifications Android & IOS

providing you with a little application sample in order to take a look

Offline

#17 2017-01-14 17:03:19

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello,

Tonym wrote:

providing you with a little application sample in order to take a look

That's ok! Please include at least the "register.php" script in order to take a look too... And anyway, since the PushPlugin sample works as expected here... please take a look at that in order to look how they works and possible differences with your own implementation.

Online

#18 2017-01-15 11:53:38

Tonym
Member
Registered: 2016-12-03
Posts: 26

Re: Push Notifications Android & IOS

Hi David
I did as u advised and  finally got it right.

I added all phps as is to the test server and  edited the api key right on the server.
Edited the sender ID in the app functions
Redirected all links to the test server
Compiled and built with Cordova.
and voila it worked

Offline

#19 2017-01-15 15:27:59

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello,

Tonym wrote:

Hi David
I did as u advised and  finally got it right.

I added all phps as is to the test server and  edited the api key right on the server.
Edited the sender ID in the app functions
Redirected all links to the test server
Compiled and built with Cordova.
and voila it worked

Well, glad to know they are worked. Certainly the PushPlugin sample works also here as expected, so they must work also for you!

Online

#20 2017-01-16 16:26:45

Tonym
Member
Registered: 2016-12-03
Posts: 26

Re: Push Notifications Android & IOS

By the way, can the notifications be styled like in Html.
For example with font color, add icons etc.

Offline

#21 2017-01-16 16:43:32

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Push Notifications Android & IOS

Hello to all,

Tonym wrote:

By the way, can the notifications be styled like in Html.
For example with font color, add icons etc.

I don't remember if the Cordova's Push plugin offer something like you wanted. The notification's icon is the the application's icon and, by default, other apparence is determined by the system. Once the user tap on the notification, then, yes, you can shown to the user whatever kind of app's message, view, etc.

Online

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.