Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.

Issues with objects in Android Notifications #175

Open
Minirock opened this issue Mar 27, 2019 · 0 comments
Open

Issues with objects in Android Notifications #175

Minirock opened this issue Mar 27, 2019 · 0 comments

Comments

@Minirock
Copy link

Minirock commented Mar 27, 2019

I'm using the bundle in order to send notification to iOS and Android like that

        if ($notif->getDeviceOs() == 1) {
            $message_bad = new iOSMessage();
            $message_bad->setMessage($notif->getContent());
            $message_bad->setDeviceIdentifier($notif->getDeviceId());
            $message_bad->setData($notif->getData());
            $this->container->get('rms_push_notifications')->send($message_bad);
        } else {
            $message_better = new AndroidMessage();
            $message_better->setMessage($notif->getContent());
            $message_better->setDeviceIdentifier($notif->getDeviceId());
            $message_better->setGCM(true);
            $message_better->setData($notif->getData());
            $this->container->get('rms_push_notifications')->send($message_better);
        }

In both case this is working, I'm receiving the notification for iOS and Android.

Problem is about the data returned by Android.

2 issues

Number 1:

iOS; field data is returned with the content of $notif->getData()
Android: field data isn't returned.
I would like to be able to get data field.

Number 2:
iOS : profile is an object
Android: profile is a string with all the objects fields in the string.

I would like to get it as an object and not a string.

Thanks for your assistance.

EDIT: Also I wonder if this might not be related as Android Notification looks like to be using gcm in the bundle:

As of April 10, 2018, Google has deprecated GCM. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features. See the migration guide to learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant