How can I change the notification sound from parse.com? - android

I've searched a lot on google ,parse.com and stackoverflow.But I really did not find what I need exactly.
I use custom BroadcastReceiver for understand the notification came.
But the sound is default sound. Is it possible to change it on android? How can I do this?
(should I do this in parse.com api or can I do this without parse.com api)
thanks in advance

As you can see in the Parse docs, you need to recieve the notification using an Intent. You can see an example of an intent implementation here, under the "Creating Android Project", item 8.
Hope it helps.

Quote from the Parse Push Developer Guide:
"For example, to send a notification that would increases the badge number by 1 and plays a custom sound, you can do the following. Note that you can set these properties from your Android client, but they would only take effect in the iOS version of your app. The badge and sound fields would have no effects for Android recipients."

Related

FCM differences between Android and iOS about data messages

I'm using Firebase Cloud Messaging to send data payload and display notification in my Android and iOS apps. I'm integrating this in my iOS app and I'm in front of a curious thing.
Short story:
My notification server only send data messages (I mean JSON messages containing "data" field and with no "notification" field). In my Android app this is not a problem because I receive the message even if my app is in background in my Service implementation and I manually build a notification that I display. But in iOS case, how can I receive message when my app is in background to do the same? I mean if I add a "notification" field to my request I see the notification pop on my screen (when app is in background) and I can get data (located in the "data" field) after a click when my app is in foreground.
But can I have data when my app is in the background to manually display a notification?
Important precision:
The content of the displayed notification should be built app side and not server side because the server doesn't have enough informations, this is why I can't send the "notification" field in my payload message.
Thanks
EDIT: I solve (in part) this problem using this link. Shortly, I enabled both Background fetch and Remote notifications under Background Modes (and added content_available : true in the payload). Then I can process data received in didReceiveRemoteNotification: But now it still one thing: how make it works when my app is killed?
EDIT 2: I found something that could be the thing : that. Modifying the payload of a remote notification implies to handle incoming notifications before there are displayed. I'll try.
EDIT 3: Firebase doesn't support the mutable-content key required to make my solution found at EDIT 2 working. Discussion about that is here. So... Any idea?
I do not think it is possible to trigger "stock" notification on iOS from code the same way you do on Android using NotificationBuilder.
The only option available is to use hybrid messages with both notification and data payloads.
Check their doc for more information on hybrid messages.
On 16/02/14, Firebase added compliance with the "mutable-content" key. So that solved my problem and, I think, many people's problems.
Personal thinking:
I consider that 6 months late for this feature is really too much. I hope that future releases'll be up to date with iOS (as well as Android) releases.

How to get notification and save it in text file for android 4.0 +?

I want to save all notification in one text file.
First I have tried it by NotificationListenerService but it's just for android 4.3+
I want that my service, support android 4.0+
Then I tried it by AccessibilityService and I did not succeed again
Would you give me some example code?
Best route is go through this simple doc and example
https://developers.google.com/cloud-messaging/
https://github.com/googlesamples/google-services/tree/master/android/gcm
This should give you all the details required.
When you receive notification.. saving message to text using any android technique.

Phonegap PushPlugin with a badge number and grouping feature

I have used pushPlugin to recieve push notification in my phonegap android application. Everything is working correctly. Only issue is when multiple messages are present in the notification bar, the last message overrides the previous message. I would like to group all the messages under the app as whatsApp does.
I tried adding notId parameter and setting it to random number from my server side code. Doing this actually displays multiple notifications but does not group then.
I would also like to know how to add badge number to my app. Basically a number which will tell the user that so many number of notifications are come. As it is in whatsApp (ex. 2 messages received). I have added this plugin to handle that, but I am not sure whether it has to be done in phonegap or will i have to modify java code (plugin) to achieve this.
I know this topic is addressed previously here but there is no answer to it. hence i have raised a new question. Any help would be appreciated.
I do think (although I totally am not sure) that WhatsApp doesn't actually show separate notifications, instead it concatenates the non-read messages on server before sending just one new notification that overwrites the current as you said. For example, if you initially have one message not read causing this notification
WhatsApp
Hey dude!
and then you receive another message, the notification sent is
WhatsApp
2 new messages from 2 contacts
or if the sender is the same contact
WhatsApp
Hey dude!\n
What is up?
You could use the pushNotification.setApplicationIconBadgeNumber(successHandler, errorHandler, event.badge);if you only needed iOS support but as it doesn't support the Android for that feature you need to use something else and that plugin you mentioned looks good for it. Seems like it is quite easy to use like this (after it is installed)
cordova.plugins.notification.badge.set(3);

What should the payload be for Android push notifications (GCM)

From my understanding of the GCM documentation you basically send whatever data you want as the data field. Then the client receives it and is responsible for handling it and displaying it. Is this wrong? What if like on iOS I just wanted to send a bit of text and have it display? Is there a standard key to use or anything? I'm pretty certain I've been through all the documentation I can find and don't see anything like this.
No, you're right. There are no standard keys like in iOS, it's all up to you seeing as you're the one responsible for the notification management.
Basically, in your BroadcastReceiver you should write the code for displaying a Notification in the status bar. Just parse your JSONObject from the recieved message and show whichever piece of text you may have set.

How to show notification in android?

I have created an android application for a RSS reader it is working fine .Now i want to show a notification to the user at the time of receiving a new blog or feed
please any one help me how to do that
Thanks in advance
Check out the NotificationManager class.
Given answer is good only #Krishna wants to develop a notification. But in his scenario, he needs to tell the user, when they receives an updates. So while you are studying the given link, also remember you should have a mechanism to Broadcast when you receive a notification even when the user is not already open your application. As a hint: you have to provide some services and permissions in Manifest file.
This documentation page also explain very well with coding.

Categories

Resources