Exemplo n.º 1
0
        protected override void ParseReceivedNotificationData(string _dataStr, out CrossPlatformNotification _receivedNotification, out bool _isLaunchNotification)
        {
            IDictionary _dataDict = JSONUtility.FromJSON(_dataStr) as IDictionary;

            _receivedNotification = new AndroidNotificationPayload(_dataDict);
            _isLaunchNotification = _dataDict.GetIfAvailable <bool>(kIsLaunchNotificationKey);
        }
		protected override void ParseAppLaunchInfo (string _launchData, out CrossPlatformNotification _launchLocalNotification, out CrossPlatformNotification _launchRemoteNotification)
		{
			Dictionary<string, object> 	_payloadDict		= JSONUtility.FromJSON(_launchData) as Dictionary<string, object>;
			
			object						_isRemoteNotification = "false";

			if(_payloadDict != null)
			{
				_payloadDict.TryGetValue(AndroidNotificationPayload.kIsRemoteNotification, out _isRemoteNotification);
	
				Debug.LogError("Launch Notification  is Remote Notification ? " + _isRemoteNotification);
				// Launched with local notification
				if (_isRemoteNotification.Equals("false"))
				{
					_launchLocalNotification	= new AndroidNotificationPayload((IDictionary)_payloadDict);
					_launchRemoteNotification	= null;
				}
				// Launched with remote notification
				else
				{
					_launchLocalNotification	= null;
					_launchRemoteNotification	= new AndroidNotificationPayload((IDictionary)_payloadDict);
				}
			}
			// Normal launch
			else
			{
				_launchLocalNotification	= null;
				_launchRemoteNotification	= null;
			}
		}
        protected override void ParseAppLaunchInfo(string _launchData, out CrossPlatformNotification _launchLocalNotification, out CrossPlatformNotification _launchRemoteNotification)
        {
            Dictionary <string, object> _payloadDict = JSONUtility.FromJSON(_launchData) as Dictionary <string, object>;

            object _isRemoteNotification = "false";

            if (_payloadDict != null)
            {
                _payloadDict.TryGetValue(AndroidNotificationPayload.kIsRemoteNotification, out _isRemoteNotification);

                Debug.LogError("Launch Notification  is Remote Notification ? " + _isRemoteNotification);
                // Launched with local notification
                if (_isRemoteNotification.Equals("false"))
                {
                    _launchLocalNotification  = new AndroidNotificationPayload((IDictionary)_payloadDict);
                    _launchRemoteNotification = null;
                }
                // Launched with remote notification
                else
                {
                    _launchLocalNotification  = null;
                    _launchRemoteNotification = new AndroidNotificationPayload((IDictionary)_payloadDict);
                }
            }
            // Normal launch
            else
            {
                _launchLocalNotification  = null;
                _launchRemoteNotification = null;
            }
        }
        private Dictionary <string, string> GetCustomKeysForNotfication(NotificationServiceSettings _settings)
        {
            Dictionary <string, string> _data = new Dictionary <string, string>();

            _data = AndroidNotificationPayload.GetNotificationKeyMap();

            return(_data);
        }
        public override string ScheduleLocalNotification(CrossPlatformNotification _notification)
        {
            string _notificationID = _notification.GenerateNotificationID();

            // Create meta info and pass to native
            IDictionary _payLoadInfo = AndroidNotificationPayload.CreateNotificationPayload(_notification);

            // Scheduling notification
            Plugin.Call(NativeInfo.Methods.SCHEDULE_LOCAL_NOTIFICATION, _payLoadInfo.ToJSON());

            return(_notificationID);
        }