Discussions

Ask a Question
Back to All

Automation push notifications doesn't work in Unity app

Documentation is not clear for the automation push notifications in Unity SDK. There is only fragments in Objective-C and Swift. We added Qonversion Launcher to GameObject, set the Debug Mode and pasted Project Key into this script. We used built in Mobile Notifications plugin to get Device Token and set it with Qonversion.SetNotificationToken(). We added pushes into Automation window, wich must show up upon subscribtion buying/cancelling, but they are not woking even though we get analitycs about this events.
Test pushes also doesn't work, even though the devices are on the list.

IEnumerator RequestAuthorization()
{
    var authorizationOption = AuthorizationOption.Alert | AuthorizationOption.Badge;
    using (var req = new AuthorizationRequest(authorizationOption, true))
    {
        while (!req.IsFinished)
        {
            yield return null;
        };
        
        Debug.Log($"TOKEN : {req.DeviceToken}");
        Qonversion.SetNotificationsToken(req.DeviceToken);
        Qonversion.SetAdvertisingID();
    }
}