Ejemplo n.º 1
0
 public static void Notification(NotificationFeedback feedback)
 {
     if (PlayerPrefs.GetInt("VIBRATION") == 1)
     {
         _unityTapticNotification((int)feedback);
     }
 }
Ejemplo n.º 2
0
        public async Task SendFeedback(NotificationFeedback feedback)
        {
            var notification = feedback.SendingStatus switch
            {
                SendingStatuses.Received
                => await _context.Notifications
                .SingleOrDefaultAsync(n => n.Id == feedback.MessageId && (n.SendingStatus == SendingStatuses.Sent)),

                SendingStatuses.Read
                => await _context.Notifications
                .SingleOrDefaultAsync(n => n.Id == feedback.MessageId && (n.SendingStatus == SendingStatuses.Sent || n.SendingStatus == SendingStatuses.Received)),

                _ => null
            };

            if (notification is null)
            {
                return;
            }

            notification.SendingStatus = feedback.SendingStatus;
            switch (feedback.SendingStatus)
            {
            case SendingStatuses.Received:
                notification.Received = feedback.StatusChangeTime;
                break;

            case SendingStatuses.Read:
                notification.Read = feedback.StatusChangeTime;
                break;
            }
            _context.Notifications.Update(notification);
            await _context.SaveChangesAsync();
        }
Ejemplo n.º 3
0
 public static void Notification(NotificationFeedback feedback)
 {
     if (!Enabled)
     {
         return;
     }
     _unityTapticNotification((int)feedback);
 }
Ejemplo n.º 4
0
        public static void Notification(NotificationFeedback notificationFeedback)
        {
#if UNITY_IOS
            TapticManager.Notification(notificationFeedback);
#elif UNITY_ANDROID
            AndroidHapticManager.Notification(notificationFeedback);
#endif
        }
    /// <summary>
    /// An overloaded method where you can change the notification feedback type
    /// </summary>
    /// <param name="notificationFeedback">Notification feedback type: Success/Warning/Error</param>
    public static void Vibrate(NotificationFeedback notificationFeedback)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        Vibrate(AndroidHapticManager.HapticFeedback());
#elif UNITY_IOS && !UNITY_EDITOR
        Vibrate(Notification(notificationFeedback));
#else
        VibrateUnity();
#endif
    }
Ejemplo n.º 6
0
 public static void Notification(NotificationFeedback feedback)
 {
     _unityTapticNotification((int)feedback);
 }
Ejemplo n.º 7
0
 public static void TriggerNotification(NotificationFeedback feedback)
 {
     _unityTapticTriggerNotification((int)feedback);
 }
    //private static void Vibrate(bool isHapticSupported)
    //{
    //    if (!isHapticSupported)
    //        VibrateUnity();
    //}


    private static bool Notification(NotificationFeedback feedback = NotificationFeedback.Success)
    {
        return(_unityHapticNotification((int)feedback));
    }
Ejemplo n.º 9
0
 public static void Notification(NotificationFeedback notificationFeedback)
 {
     //#if UNITY_ANDROID && !UNITY_EDITOR
     //                return UnityPlayer.Call<bool> ("performHapticFeedback",HapticFeedbackConstantsKey);
     //#endif
 }