Open yaroslavsnisarua opened 7 years ago
Hello! First of all, thank you very much for great lib! Im using it on laravel 5.1) In testing i have a same problem.
$optionBuilder = new OptionsBuilder(); $optionBuilder->setTimeToLive(30); $notificationBuilder = new PayloadNotificationBuilder('Auth'); $notificationBuilder->setBody('Auth request...') ->setSound('default'); $dataBuilder = new PayloadDataBuilder(); $dataBuilder->addData(['a_data'=>[ 'mode'=>'auth', 'private_key'=>'12345678901234567890123456789012' ] ]); $option = $optionBuilder->build(); $notification = $notificationBuilder->build(); $data = $dataBuilder->build(); $token = '...'; $downstreamResponse = FCM::sendTo($token, $option, $notification, $data);
and on Android i receive:
{a_data={“mode”:“auth”,“private_key”:“MXaFORX1dKZpXMCaiLl5uNo74yOqOTJW”}}
thats Ok! I can use a_data as json/object...
BUT on iOS i have a problem!
Push notification received: { “a_data” = “{\“mode\“:\“auth\“,\“private_key\“:\“TpbgLUn1Zq6WwREJxy3yGvgjEeaun75z\“}”; aps = { alert = { body = “Auth request...“; title = Auth; }; sound = default; }; “gcm.message_id” = “0:1496937050152314%939d13c6939d13c6"; }
a_data variable have string type, i can not use it.
Can you explain, how can i use sub-array in $dataBuilder->addData for iOS json/object type?
Hi,
Your question need that I investigate a lot, I will try to find a solution and I will come back to you
Best Regards
anything on this..? facing the same issue.. on laravel 5.8
Hello! First of all, thank you very much for great lib! Im using it on laravel 5.1) In testing i have a same problem.
and on Android i receive:
thats Ok! I can use a_data as json/object...
BUT on iOS i have a problem!
a_data variable have string type, i can not use it.
Can you explain, how can i use sub-array in $dataBuilder->addData for iOS json/object type?