This is a migrated thread and some comments may be shown as answers.

Push Notification - No Sound, Vibration

4 Answers 311 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bruce
Top achievements
Rank 1
Bruce asked on 21 Sep 2013, 07:23 PM
All,

I am getting notifications, but they never trigger a sound or vibration on my device. This is happening in my app as well as the Icenium Everlive Push sample app, which I have not edited. I have verified that my phone is set properly for sound/vibration etc.

Device
iOS 6.1.3
iPhone 4S

Plugin
com.phonegap.plugins.pushPlugin-1.2.2

PhoneGap Version(s)
2.7 in both my app and the sample app

My Icenium Code
var pushSettings = {
    iOS:{
        'badge': 'true',
        'sound': 'true',
        'alert': 'true'
    },
    android:{
        'senderID': '1096136230769'
    },
    notificationCallbackIOS : onIosPushReceived,
    notificationCallbackAndroid : onAndroidPushReceived
};

My API Server Code
EverliveApp elApp = new EverliveApp(this.APIToken);
 
var notification = new PushNotification();
//notification.Message = message;
if (devicePlatform.ToUpper() == "IOS")
{
    notification.iOS = new Telerik.Everlive.Sdk.Core.Model.System.Push.IOS.IOSNotification();
    notification.iOS.CustomProperties.Add("aps.alert", message);
}
else if (devicePlatform.ToUpper() == "ANDROID")
{
    notification.Message = message;
}
 
notification.Filter = Filter;
elApp.WorkWith().Push().Notifications().Create(notification).ExecuteSync();

4 Answers, 1 is accepted

Sort by
0
Pavel Iliev
Telerik team
answered on 26 Sep 2013, 11:14 AM
Hi,

Can you try with this settings:
{
    "alert": "message",
    "badge": 1,
    "sound": "default"        
}

       

Regards,
Pavel Iliev
Telerik

Big news for mobile app and .NET developers! Hear about it at our Release Keynote. Thursday, September 26th, 11AM EDT
Do you enjoy Icenium? Vote for it in Windows IT Pro Community Choice Awards as Best Cloud Computing Product or Service (Category 5).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Ahsan
Top achievements
Rank 1
answered on 18 Mar 2015, 12:45 PM
Hi Pavel,

I'm facing same problem (sound & badge), change accordingly your comment but same issue occurring again.

in the mean while i have to change template 
var template = "{\"aps\":{\"alert\":\"$(message)\",\"sound\":\"default\"}}"; or var template = "{\"aps\":{\"alert\":\"$(message)\",\"sound\":\"default\",\"badge\":1}}";
instead of this
var template = "{\"aps\":{\"alert\":\"$(message)\"}}";

sound working but badge still on grey shade.

iOS 7 or 8 
com.phonegap.plugins.PushPlugin 2.4.3
Cordova V 3.5.0

Please Guide how to resolve this.



0
Ahsan
Top achievements
Rank 1
answered on 18 Mar 2015, 01:31 PM
 onNotificationAPN: function (event) {
 alert(JSON.stringify(event));
       if (event.alert){
navigator.notification.alert(event.alert);
refreshTodoItems();
}

if (event.sound){
var snd = new Media(event.sound);
snd.play();
}

if (event.badge){
    pushNotification.setApplicationIconBadgeNumEber(successHandler, errorHandler, event.badge);
   
}
    },

alert return these values "alert" & foreground but "badge"  missing 
Msg: {"alert":"new item added: test 123","sound":"default",foreground:"0"}
0
Anton Dobrev
Telerik team
answered on 20 Mar 2015, 11:44 AM
Hi Ahsan,

When a notification is received on iOS and the app is not running, the notification event is handled on a system level (if the badge is allowed in the Notification center for the app). The system sets the badge value according to the "badge" value in the notification payload.

Make sure that you are registering the device with option "badge": true and that you are sending a payload that contains the value of the badge as integer.

Also, please verify in the Notification Center of the device app that the badges are allowed for this app.

Regards,
Anton Dobrev
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Report a bug
Asked by
Bruce
Top achievements
Rank 1
Answers by
Pavel Iliev
Telerik team
Ahsan
Top achievements
Rank 1
Anton Dobrev
Telerik team
Share this question
or