google-cloud-messaging

Android-How to set Custom notification sound for GCM messages

牧云@^-^@ 提交于 2019-12-11 18:39:34
问题 I want to set custom Alert sound for GCM notifications..Here is my current coding.. Uri notification = RingtoneManager .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Ringtone r = RingtoneManager.getRingtone( context.getApplicationContext(), notification); if(r!= null){ r.play(); } Intent i = new Intent(context.getApplicationContext(), CjStartingActivity.class); I have mp3 file in Res folder (Res.raw.mi.mp3). 回答1: Use following Code:- private void sendNotification(String msg) {

Not receiving GCM notifications with app in background and content-available=1

元气小坏坏 提交于 2019-12-11 18:37:59
问题 I developing an Ionic 2 app and testing on Android emulator. When the app is in background and the notification has no title, no message and content-available=1 the notification should be sent directly to app notification handler. But its not happening. I can receive notifications with the app in foreground. If I have a title and a message I receive the notification in the notification area. But I need to send the notification directly to the app in silent mode, without pass by the

GCM registering twice with 2 different regIds

♀尐吖头ヾ 提交于 2019-12-11 18:33:17
问题 in my app I have this code to register to the GCM service: Server.java protected void registerToGcm() { GCMRegistrar.checkDevice(mContext); GCMRegistrar.checkManifest(mContext); String regId = GCMRegistrar.getRegistrationId(mContext); if ("".equals(regId)) { GCMRegistrar.register(mContext, GCMIntentService.SENDER_ID); } else { registerToServer(regId); } } GCMIntentService.Java public static final String SENDER_ID = "1111111111"; @Override protected void onRegistered(Context context, String

GCM client does not receive downstream messages

情到浓时终转凉″ 提交于 2019-12-11 16:51:27
问题 My app server is sending out messages to GCM successfully, however, in the client side, the messages are not being received, even though it has the token and it has been subscribed to different topics. For listening to the incoming messages, I am using an extension of GcmListenerService. Since this is a service, it starts from the mainactivity. Bellow is the relevant part of the manifest: <!-- [START gcm_permission] --> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE

Push notifications quotas in GCM and APNS

ぃ、小莉子 提交于 2019-12-11 16:31:50
问题 I am creating a mass marketing application where I can send coupons to all of my subscriber base which can be a few millions people and I should be able to send coupons through out the day as many times I want. So,my confusion is will my mission be hindered by any kind of quotas like amount of push notifications in a day/week/month on these popular services.Also,is there any possibility of my app getting banned for sending so many messages to people. My app won't spam the user with irrelevant

PushNotification not working with the app in background

≯℡__Kan透↙ 提交于 2019-12-11 16:19:44
问题 I'm developing an iOS and android app using ionic/cordova , and I'm trying to get the push notifications working on both platforms with the PushPlugin library. The thing is I'm getting the push notifications working OK for iOS , but in android is a little weird what is going on, when the app is in foreground, the notification arrives successfully , but when the app is in background (the app is close), the notification never arrives... Any thoughts about this? Permissions ? I followed this

Android GcmListenerService parallel?

烈酒焚心 提交于 2019-12-11 16:08:18
问题 Does the GcmListenerService process the gcm messages in parallel or sequentially? I know that normal Android services run in the main thread. But does that also apply to GcmListenerService ? 回答1: GcmListenerService processes messages in parallel in background threads, see the note in the docs that methods are invoked asynchronously. So you are able to do blocking tasks in onMessageReceived() without worrying about blocking future messages. 来源: https://stackoverflow.com/questions/35219490

Migrating from GCM to FCM

99封情书 提交于 2019-12-11 15:34:35
问题 In the Firebase Console once we import GCM project to FCM I saw that it creates a new API key. Will the old GCM API key also work? 回答1: just create your project on FCM and follow below link https://firebase.google.com/docs/cloud-messaging/android/client and register your project and download google json file andput in your project enjoy 来源: https://stackoverflow.com/questions/53951147/migrating-from-gcm-to-fcm

Android APP migrates from GCM to FCM. Old GCM tokens do not work

£可爱£侵袭症+ 提交于 2019-12-11 14:23:36
问题 The document from Google says: GCM tokens retrieved via GoogleCloudMessaging.register() or InstanceID.getToken() will continue to work in FCM without any modification or renewal. But when I update my APP to FCM. The old GCM token which stores in my Server does not work anymore. When I tried to send a push message, the Google Message server response the error message, not registered. Does anyone ran into the same problem? 回答1: Based from the documentation of GCM and FCM FAQ: Will your existing

Android Notification: GCM or Service [closed]

邮差的信 提交于 2019-12-11 14:13:00
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I would like to notify (create a notification) user whenever he receives an in-app request. I'm using a MySQL Database with PHP - regular stuff. Whenever the value of the user_id_req field changes from 0 to 1 , the app should create a notification. I was able to do it on App