Ejemplo n.º 1
0
        public static bool TryGetPlatform(this RegistrationDescription registration, out PushPlatformEnum platform)
        {
            switch (registration)
            {
            case AppleRegistrationDescription a:
                platform = PushPlatformEnum.iOS;
                return(true);

            case FcmRegistrationDescription g:
                platform = PushPlatformEnum.Android;
                return(true);

            default:
                platform = PushPlatformEnum.Android;
                return(false);
            }
        }
Ejemplo n.º 2
0
        private static string RetrieveDeviceHandle(PushPlatformEnum platform, RegistrationDescription description)
        {
            switch (platform)
            {
            case PushPlatformEnum.iOS:
            {
                return(((AppleTemplateRegistrationDescription)description).DeviceToken);
            }

            case PushPlatformEnum.Android:
            {
                return(((FcmTemplateRegistrationDescription)description).FcmRegistrationId);
            }

            default:
            {
                return(null);
            }
            }
        }
Ejemplo n.º 3
0
 public PushSubscriptionRequest(string deviceHandle, PushPlatformEnum platform, IEnumerable <string> tags)
 {
     DeviceHandle = deviceHandle;
     Platform     = platform;
     Tags         = tags;
 }
Ejemplo n.º 4
0
 public PushTokenRequest(string token, PushPlatformEnum devicePlatform)
 {
     Token          = token;
     DevicePlatform = devicePlatform;
 }