google-cloud-messaging

Corresponding GCMRegistrar.isRegistered() in new GCM

痴心易碎 提交于 2019-12-12 22:25:21
问题 I am trying to implement GCM using the new GoogleCloudMessaging API . I want to check whether the device is registered on the cloud, which was previously checked using GCMRegistrar.isRegistered() . Is there any way I can achieve this check using the new API? EDIT: I know I can save the registeration Id in my app, but I want to know the status of my device on the cloud - whether it is registered or not. 回答1: The deprecated GCMRegistrar was just a helper client class that stored the

Android GCM push notification without server OR GCM push notification using Microsoft SQL(Not Mysql) and WCF service(Not PHP)

假装没事ソ 提交于 2019-12-12 21:28:35
问题 Hello to all, I am trying to create android GCM without using server. I don't want to store. Because i don't have server.Is it possible? If it's not possible then i want to store using WCF Service and MS SQL(Microsoft SQL). In online search all are given sample codes using PHP and MySQL. If any one know WCF service and MS SQL sample code means give me a refer. Thanks in advance. 回答1: To send push notifications, all you have to do is make a post request to https://gcm-http.googleapis.com/gcm

Push Notifications without Firebase Cloud Messaging

久未见 提交于 2019-12-12 21:02:37
问题 Can one use a 3rd party service to send Push Notifications without relying on Google's Firebase Cloud Messaging (FCM)? If the Firebase package is not included with the app by default, could creating / using a custom framework have a similar feature set as Firebase? Or is Firebase integrated within the Android Operating System in some way that is external from an app? 回答1: So it depends on your requirements. So if you want to just send normal notifications, then I can really recommend the

Android Notification FCM vs simple pull

旧巷老猫 提交于 2019-12-12 18:17:38
问题 for my android app i need to receive some notifications from a server. The notifications are by no mean time critical and it would be enough to check for new notifications when the user opens the app, so no background activity at all. I noticed, that it is recommended to use a service like FCM (Firebase Cloud Messaging) for any kind of notifications. However, I feel that I would introduce quite a big library for a very simple task with FCM, potentially causing worse battery life than just

Callback on “clear all” button in notification area

久未见 提交于 2019-12-12 15:18:17
问题 I am developing and android app where i have to count how many times the app started through a notification. My problem is that i can't catch the event where the user presses "clear button" from the notification area. Is there any way or a callback in order to know when the clear button pressed? I have read about deleteIntent but i don't know how to use it. Thank you in advance 回答1: Create a deleteIntent Intent deleteIntent = new Intent(context, NotificationReceiver.class); deleteIntent

Non-static method isGooglePlayServicesAvailable and getErrorDialog cannot be referenced from a static context

感情迁移 提交于 2019-12-12 15:15:19
问题 I am writing this code and it shows the error non-static method GoogleApiAvailability.isGooglePlayServicesAvailable(Context context) and GoogleApiAvailability.getErrorDialog (Activity activity, int errorCode, int requestCode) cannot be referenced from a static context. package com.xamarin.gcmexample; import android.app.Dialog; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common

Azure Notification Hub: 'Test Send' was successfully sent, but not any GCM traffic. Why?

旧时模样 提交于 2019-12-12 15:01:48
问题 In the Azure Portal, I created a Notification Hub. And in "Push notification services - Google (GCM)", I entered the API Key value that I obtained from GCM. In order to verify my settings of Azure Notification Hub and GCM, I ran 'Test Send' in Azure Portal - Notification Hub. I got a message in Portal soon as below. Successfully sent test message. Outcome: {1 passed, 0 failed}. Please see result section for details. BUT I have not gotten any message traffic in GCM. Refer to the screenshot,

Warn user if Google Services' Restrict background data option is activated

喜欢而已 提交于 2019-12-12 14:31:42
问题 On android 5, and possibly earlier, if a user goes to his "Data usage" settings, and enables an option called "Restrict background data" for his "Google Services" app, he will no longer receive push notifications while on his mobile network. Users get told to do that by random websites for security/mobile data/battery reasons, and they forget about it. We would like to be able to warn user that it is this option is causing them to not reliably receive push notifications, is there any way to

Google Cloud Messaging - Registration ID status

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 13:52:54
问题 I am using the new GCM APIs in order to register. The documentation of the method clearly states: Register the application for GCM and return the registration ID. You must call this once, when your application is installed, and send the returned registration ID to the server. Repeated calls to this method will return the original registration ID. However, while reading this article (http://developer.android.com/google/gcm/adv.html#reg-state), it states that there are two cases that need

Android GCM - Send different payload to each user in registration_ids array

时间秒杀一切 提交于 2019-12-12 13:14:04
问题 In a multicast GCM trigger, I want to send different payload to each user. My GCM json corresponding array is as follows: $fields = array( 'collapse_key' => 'demo', 'registration_ids' => $registration_ids, 'data' => array('myjson' => 'abc'), ); Consider the registeration_ids array as follows: $registration_ids => array('id1','id2','id3'); With the above mentioned GCM json corresponding array, all the users get same value of 'myjson'. Is there any way that i can design the json corresponding