Yahya
Posts: 0
Joined: Tue Nov 11, 2014 1:08 pm

push notification customData for ios

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.

Yahya
Posts: 0
Joined: Tue Nov 11, 2014 1:08 pm

push notification customData for ios

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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

push notification customData for ios

Hello Yahya,

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

Yahya
Posts: 0
Joined: Tue Nov 11, 2014 1:08 pm

push notification customData for ios

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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

push notification customData for ios

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

Yahya
Posts: 0
Joined: Tue Nov 11, 2014 1:08 pm

push notification customData for ios

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.

Yahya
Posts: 0
Joined: Tue Nov 11, 2014 1:08 pm

push notification customData for ios

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

push notification customData for ios

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.

Yahya
Posts: 0
Joined: Tue Nov 11, 2014 1:08 pm

push notification customData for ios

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.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

push notification customData for ios

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.

Return to “Issues”