예제 #1
0
        internal static AndroidNotificationCategoryGroup FromCrossPlatformCategoryGroup(NotificationCategoryGroup categoryGroup)
        {
            if (categoryGroup == null)
            {
                return(null);
            }

            var g = new AndroidNotificationCategoryGroup();

            g.id   = categoryGroup.id;
            g.name = categoryGroup.name;

            return(g);
        }
예제 #2
0
        internal static string ToJson(NotificationCategoryGroup[] categoryGroups)
        {
            if (categoryGroups == null)
            {
                return(Json.Serialize(new string[0]));
            }

            // Convert to array of JSON.
            var jsonStrArray = new string[categoryGroups.Length];

            for (int i = 0; i < categoryGroups.Length; i++)
            {
                jsonStrArray[i] = AndroidNotificationCategoryGroup.FromCrossPlatformCategoryGroup(categoryGroups[i]).ToJson();
            }

            // Encode to single JSON string.
            return(Json.Serialize(jsonStrArray));
        }