Push Notifications Error

Brookalino

Member
Licensed User
Longtime User
This is regarding the Push Notification Example..

Hi Erel..

I am getting the 'Error=InvalidRegistration' error (shown in the attached picture) and just cannot figure out the problem.:sign0080:

This is where i am at..
I ran the original PushExample and everything worked fine..
Registered names, sent messages, received messages... no problem.


I then modified the PushExample with my web based server info, my API info, passwords etc..
I run the modified example and i can register names. (I checked my server database and they are there)

I run the cmd prompt... 'b4a_gcm.bat getall ' and i can see the names that are registered...


I then try to send a message and keep getting the error :

PushExample_CMD_Error_zpscb48e295.jpg


I have looked everywhere for a solution and it's driving me up the wall!! :BangHead::BangHead::BangHead:

I'm not sure if the below quote from mading1309 is the problem but I'm confused as to where the modified C2DM.java file go to test this?

Hi

Thanks to Erl for this tutorial

I was successful using the MQSQL database on the B4A server
When I switched to the free Hosting Free Web Hosting with PHP, MySQL and cPanel, No Ads for MySQL service the Push service does not run.

After some checks and thanks for the JAVA Source, I found out that an ECHO command of the PHP script are some lines attached containing HTML code calling a javascript

APA91bFIF6d_6hPEEKHcYtGbDQqi- ... O9n8xZ9mg
<!-- Hosting24 Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->

The first line is the registration ID, the following lines must be removed that the Push service works again.

I modified the JAVA desktop application
In the method call of object RequestResult I add at the end before return the result the following code to remove the Hosting24 attachment

// In case some free providers add java script call
// for echo or print commands in PHP
// use only 1st line for ID
if (rr.text.length()>0) {
t=rr.text.split("\n");
rr.text = t[0];
}

With this changes of the JAVA application the PUSH services works also with the free hosting service of Free Web Hosting with PHP, MySQL and cPanel, No Ads

I attached my modified JAVA application

Any help would be greatly appreciated..

Thanks

Brookalino
 
Top