Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deeplink with Push notification for Unity 2019.4 (android , iOS) not working #83

Open
mudassar024 opened this issue Mar 25, 2021 · 3 comments

Comments

@mudassar024
Copy link

mudassar024 commented Mar 25, 2021

Braze Unity android deeplink in push notification issue:
Deeplink was working fine in Unity 2018.4.26 with Braze Unity plugin 2.7.1
After updating Unity to 2019.4.22 with Braze Unity plugin 2.8.0, deeplink with push notification is not working.
Receivenig notificaton data and deeplink uri in logs only if app is already open, but not if app is closed.

Braze Unity iOS deeplink in push notification issue:
Deeplink with push notification was not working in Unity 2018.4.26 with Braze 2.7.1
After updating Unity to 2019.4.22 with Braze Unity plugin 2.8.0, deeplink with push notification is working for only those users who already registered there push token.
Here is the detail:
to get device token for Unity 2019.4.22

IEnumerator RequestUninstallToken()
{
    const AuthorizationOption AUTHORIZATION_OPTION = AuthorizationOption.Alert | AuthorizationOption.Badge;
    using (var req = new AuthorizationRequest(AUTHORIZATION_OPTION, true))
    {
        while (!req.IsFinished)
        {
            yield return null;
        }
        if (req.Granted && req.DeviceToken.IsNotNullNorEmpty())
        {
             Appboy.AppboyBinding.RegisterAppboyPushMessages(Encoding.UTF8.GetBytes(req.DeviceToken));
        }
    }
}

Braze says BadDeviceToken when try to send notificaion. so no notification received.

But if we use Obsolete method

NotificationServices.RegisterForNotifications(NotificationType.Alert | NotificationType.Badge | NotificationType.Sound);
Appboy.AppboyBinding.RegisterAppboyPushMessages(UnityEngine.iOS.NotificationServices.deviceToken);

token register successfully and we are receiving push notification, but deeplink is not working in this case..

Next we remove this line
NotificationServices.RegisterForNotifications(NotificationType.Alert | NotificationType.Badge | NotificationType.Sound);
and build , now push notification is working deeplink.. (because braze has device token already)

but how we register device token without calling "NotificationServices.RegisterForNotifications"
Without calling this "NotificationServices.RegisterForNotifications"
NotificationServices.deviceToken return null so we can't register device.

Q1. deeplink with push notification for unity android is not working?
Q2. How do we register correct device token with new Unity version 2019.4.22?
Q3. Why deeplink is not working when "NotificationServices.RegisterForNotifications" is in the code to get device token with obsolete method?

@Bucimis
Copy link
Collaborator

Bucimis commented Mar 25, 2021

Hi @mudassar024, there were no changes to deep linking or push registration behavior between Braze Unity SDK versions 2.7.1 and 2.8.0.

Do you need a way to send a String instead of a byte[] into RegisterAppboyPushMessages on iOS? AuthorizationRequest's documentation recommends sending the String type DeviceToken back to the server unmodified (see https://docs.unity3d.com/Packages/[email protected]/api/Unity.Notifications.iOS.AuthorizationRequest.html) - wonder if that's causing any issues. Though again, that's not related to deep links and nothing has changed on the Braze end there or in our registration code for some time.

@mudassar024
Copy link
Author

mudassar024 commented Mar 30, 2021

Here is only one question.
How we can get deeplink uri with parameters in Unity , sent from braze dashboard with notification..
(deeplinking is working fine with Appsflyer, because they have onAppOpenAttribution callback, where we can get link with paramters.. but in braze there is no such callback for notification deeplink...)

@Bucimis
Copy link
Collaborator

Bucimis commented Mar 30, 2021

Hi @mudassar024, we don't currently offer a convenient way to read the push deep link from the Unity layer, but have added it to our roadmap. Currently, we'd recommend working around this by implementing ABKURLDelegate and AppboyNavigator on iOS and Android natively, respectively. Those methods will allow you to intercept all deep links flowing through Braze and take action based on them. Let us know if that works for you.

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

No branches or pull requests

2 participants