Skip to content

get userinfo of a remote notification #77

@MaxMaioli

Description

@MaxMaioli

Hallo Stan, i'm very happy with your plugin, i love it.
I'm using the remote notifications, but i can get userinfo to work.

Here is the payload of my push:

{
"APNS_SANDBOX": "{"aps":{"alert":"A new app is available to download.","badge":1,"sound":"default"},"custom":{"link":"[https://download.mylink.com](https://download.mylink.com/)"}}"
}

i expected to get the custom node info using the function GetUserInfo but is it always null.

My unity code is:

Class UserInfo
`
using System.Collections.Generic;

[System.Serializable]
public class UserInfo
{
public List custom;
public int status;
}

[System.Serializable]
public class mycustom
{
public string link;
}
`

code to retrieve the notifications:

`
ISN_UNUserNotificationCenter.GetDeliveredNotifications((result) =>
{
Debug.Log("TotaleNotifiche: " + result.Count);

        foreach (ISN_UNNotification item in result)
        {
            Debug.Log(item.Request.Content.GetUserInfo<UserInfo>());
        }

        ISN_UIApplication.ApplicationIconBadgeNumber = result.Count;
    });

`

please, can you help me?

thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions