Page 1 of 2

push notification customData for ios

Posted: Tue May 08, 2018 7:21 am
by Yahya

Good day

I have an issue in ios customData received by IOS devices.
the data received having back slash in all object values therefore
I can't read them or compare values.

In android everything is working fine.

Thank you for your support.


push notification customData for ios

Posted: Tue May 08, 2018 2:05 pm
by Yahya

Dears any help for this issue, I have tried many ways but unfortunately nothing work with me. IOS received push data but but customData appear with duopl slash..

Appreciate your usual support.


push notification customData for ios

Posted: Tue May 08, 2018 6:22 pm
by Serhii Kulibaba

Hello Yahya,

Could you please clarify what you have tried and what exactly does not work?


push notification customData for ios

Posted: Tue May 08, 2018 6:40 pm
by Yahya

Thank you for your reply,
My issue is when I send push notification with custom Data I got undefined values in IOS when data push received. The customData is like this

var myinfo={
name : "sam",
age: "35",
address: "KSA"
}

then in payload I put

customData: myinfo

In android I got the values by access
data . additionalData.name the result is = sam

In IOS data . additionalData.name is = undefined

Thank you.


push notification customData for ios

Posted: Tue May 08, 2018 7:30 pm
by Serhii Kulibaba

Please print the alert with the full data object with the JS code prealert(JSON.stringify(data));/pre What value did you get?


push notification customData for ios

Posted: Tue May 08, 2018 8:22 pm
by Yahya

I have print the full data and got the JSON result the same code is working in android but not in IOS.

Any help can solve this problem. I am really can't find where is the issue.


push notification customData for ios

Posted: Wed May 09, 2018 1:50 pm
by Yahya

can I found solution for this ios issue...?


push notification customData for ios

Posted: Thu May 10, 2018 8:43 am
by Illya Stepanov

Hi Yahya -

It's not clear how exactly you're sending this customData content as a push message -- could you please provide more details about this?

Or if this would be easier provide us with the small app sample showing the case that you're getting.


push notification customData for ios

Posted: Thu May 10, 2018 9:51 pm
by Yahya

Hi Illya,,

below is the small app..

  1. create object
    var myInfo={
    "_id":"123456",
    "nationalID":"98765432",
    "username":"yahya",
    "requestInfo": {
    "date":"10/10/2017",
    "id":"9090909090",
    "destination": ["24.111112212","21.98978654"],
    "price": "99"
    },
    "ratingInfo":{
    "driverID": "88776655",
    "requestID": ''44332222",
    ""serviceType":"",
    },

    Code: Select all

     "chating":{ 
         "msg":"do what you do..", 
         "date":"10/10/2017" 
     } 

};

  1. send push notification service,
    sendPushService.execute({
    data: {
    "payload":{
    "message":"New message pushed to you",
    "badge":1,
    "title":"Note",
    "sound": "www/"+pushSound,
    "customData": myInfo
    },
    "status":"sent",
    "filter": {'deviceID':{'$in':["355afb826838e345","753b2e5d90a41155","5A4DF95C-E9C7-40F5-B340-1A56CBFA9EF7"]},'type':{'$in':['I','A']}};,
    "priority" : "high"
    },
    success: function(data){
    if(requestType=="requestClosed"){
    //hisInfo.requestInfo.id='';
    }
    },
    error: function(){

    Code: Select all

                                 } 

});

  1. in startPage push notification event ( I got the data correctly in Android but in IOS I got wrong JSON response with backslash. below if statement worked in Android but not in IOS.

    if(data.additionalData.requestInfo.type=='requestSatha' || data.additionalData.requestInfo.type=='requestForChat'){
    login_service_login_page.execute();

    }

    Thank you.


push notification customData for ios

Posted: Fri May 11, 2018 7:59 am
by Illya Stepanov

Thank you, I meant that is it possible for you to create an Appery.io app sample that will show this push sending mechanism that you're currently using -- so that we can send it to our QA department for testing.