找到你要的答案

Q:How to send push notification to an android device before an application is opened means none of the activity is launched even once?

Q:在应用程序打开之前,如何向Android设备发送推送通知意味着该活动没有一次启动?

When none of the activity is launched even once,i want to send a push notification to the user. For example, once user installs application but doesnt open then a notification is pushed that please use the application. Please help me with the code.

When none of the activity is launched even once,i want to send a push notification to the user. For example, once user installs application but doesnt open then a notification is pushed that please use the application. Please help me with the code.

answer1: 回答1:

You can't. How would the user call the registration process for the push messages if he never ran the app itself? Until he does, the app is considered to be in a stopped state and you can't interact with it unless you have another app installed that would "start" it.

如果他从来没有运行过应用程序,那么用户如何调用注册过程的推送消息呢?直到他这样做,该应用程序被认为是处于停止状态,你不能与它交互,除非你有另一个应用程序安装,将“开始”。

answer2: 回答2:

You can start a background service on application level and registering on gcm server and other process so even if app is not used you can send notification as your service has registered your device with gcm id on your server.Call api for registering device to your server from your GCMIntentService class.

你可以在应用程序级别的启动一个后台服务和注册服务器和其他过程的GCM所以即使应用程序不使用你可以发送通知为您服务与GCM ID在你的服务器上注册你的设备。调用API注册设备到您的服务器从你的gcmintentservice类。

android  push-notification