Do not send push to users who no longer have the app? - php

I have a GSM PUSH panel and it happens that when user installs the app I record his id to send future notifications.
But after it uninstalls I continue with the ID of it saved in the database and whenever I run my routine, it sends the push to those users even without having the app installed.
The problem is that I already have thousands of id's and now it's taking more and more to send.
Is it possible to know who does not have the app installed anymore and put a flag in the database so it is no longer sent?
Example of JSon return:
{"multicast_id":5157270514039936452,"success":2,"failure":1,"canonical_ids":0,"results":[{"message_id":"0:1474029083357948%0e3f0485f9fd7acv"},{"error":"MismatchSenderId"},{"message_id":"0:1474029083356778%f17b55e1f9fd7erf"}]}

You have to implement it:(https://developers.google.com/cloud-messaging/registration)
The end user uninstalls the client app.
The app server sends a message to GCM connection server.
The GCM connection server sends the message to the GCM client on the device.
The GCM client on the device receives the message and detects that the client app has been uninstalled; the detection details depend on the platform on which the client app is running.
The GCM client on the device informs the GCM connection server that the client app was uninstalled.
The GCM connection server marks the registration token for deletion.
7. The app server sends a message to GCM.
8. The GCM returns a NotRegistered error message to the app server.
9. The app server should delete the registration token.

Related

How to get messege from server with less data usage in Android?

I am writing a Android program that get message from server. I can refresh my program every second to get message from server, but I don't want to do this work.
Is it possible to send message from server to client IP and then get message with my Android program (that installed in client device)?.
If it is not possible, please say me way to get message from server.
You can use this
1) Use push Notification in your app
2) When user click notification refresh your app (make a http request to your server fetch the update info).
OR
If you don't want to show notification in mobile which is no harm (almost every news app does this). Just don't create notification refresh you app.
for more information refer this
GCM
pushnotification in android

Apple Pushnotification Feedback service

I have a problem with IOS push notification. I am using php(Zend) as a provider. I have tested the notification in below scenarios:
1) Installed app in my iPhone and sends the device token to server and it is successfully stored in database. Then i have fired a notification, and i have received notification.
2) Then i have uninstalled the app from device and fired a notification. In this scenario APNS doesn't returned any error message. Feedback service also not gave any invalid tokens (Device has other apps which has push notification enabled).
3) Installed app again then send the notification. Now, The notification is successfully sent.
So my question is, why apns not returned invalid token when app is uninstalled from the device. Why feedback service not returned any invalid tokens?
Thanks in advance
When you uninstall an application, it does not get de-registered from the push server. So, this is normal behaviour. You won't get any invalid token error.

send notification to android device from server without GCM(Google Cloud Messaging)

I have to send notification from server to android device. I developed application which got notification from server by using GCM (Google Cloud Messaging). But as I already have server then why to use GCM. I am not getting the purpose of using GCM. Can we send notification from server to android application without using GCM.
General Communication Pattern :
Device --> HTTPRequest -- >Server , Server -->HTTPResponse --> Device
But in this case, the device gets a response only when you send a request from your device to the server. Hence, whenever you need something new from your server you need to make a
request.
Using GCM, you do not need to make this request explicitly to your server. You'll automatically be notified when something new happens (depending on your implementation).
You are having server but GCM is totally different thing then your server.
GCM will monitor Your Application server that any changes made or not ??
And if anything created then it will send you notification without refresh or reload the Application.
and GCM will send you notification when your application is not working as well

not being able to establish device-to-device messaging using GCM

I am trying to establish device to device messaging using Google Cloud Messaging. I tried using socket programmng, but the connection used to get lost everytime I moved to the next page. Thus I am using GCM. The plan is to send a message from client's phone and it should be displayed on server's phone, using 3g/wifi and not bluetooth.
I am referring the following link for the same:
http://androidexample.com/Device_To_Device_Messaging_Using_Google_Cloud_Messaging_GCM_-_Android_Example/index.php?view=article_discription&aid=122&aaid=142
It has no errors and is running, but nothing is displaying on the screen. Also a few doubts:
In the code in CommonUtilities.java what should be the Server_Url? I am using XAMPP, so should it be XAMPP's URL?
Also, what should be the Sender_ID?
Also in MainActivity.java, what should be the device IMEI? Do we have to enter that manually, or will the device fetch on ots own.
Also in the php files, its written enter "GCM Registeration ID got from device".Is it client's ID? I am running using Google API and registering my ID in the settings of the emulator before proceeding further.
Can anyone please tell me where am I going wrong? Or even if you have a better idea, please do share here. I am looking for mobile to mobile communication only, not using push notifications.
GCM is working as follow:
1/First of all you have to register your application in google and get your Sender_ID
2/the client connect to GCM cloud in order to register it self (using the SENDR_ID)
3/GCM cloud send a registrationID to the client
4/You should make a server so that you save the registrationID of any device that runs your apps
If you want to send a GCM notification from one client to server
1/the client should connect to your server
2/tell the server to make a demande to the GCM cloud containing the registrationID of the server so that the GCM send the notification to the server
you will find a detailed explanation here

Get data from a server with Objective-C

I'm trying to make a notification system between a PHP server and an iOS device, just like in the Facebook App.
I already know how to make a PHP request via GET or POST and wait for a response. But I would like to receive server's responses without any request, is it possible? Or should I make a request every x seconds?
Look into Apple Push Notification Service (APNS). You send a message to the APNS server, and the server sends a notification to the device(s) you specified. This is standard practice for apps like Facebook.
When the device receives a notification, it sends it to the app (if the app is running) or alerts the user (if it's not). The user can choose to start the app, at which point the notification is delivered. The app can then respond by contacting your server to update its information or whatever.

Categories