Пример #1
0
        protected async override void OnStart()
        {
#if DEBUG
            System.Diagnostics.Debug.WriteLine("*******************************************************************");
            System.Diagnostics.Debug.WriteLine("*********  SilentRemoteNotificationReplyActivity OnStart  *********");
            System.Diagnostics.Debug.WriteLine("*******************************************************************");
            if (ViewModel == null)
            {
                System.Diagnostics.Debug.WriteLine("******************** ChatViewModel is NULL  ***********************");
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("******************** ChatViewModel is Valid  ***********************");
            }
#endif

            base.OnStart();

            switch (_action)
            {
            case Constants.ActionEmergency:
#if DEBUG
                System.Diagnostics.Debug.WriteLine("*********  Action Emergency  *********");
#endif
                await ViewModel?.ActivateChatPromptAsync(ChatPromptType.Emergency);

                break;

            case Constants.ActionSafe:
#if DEBUG
                System.Diagnostics.Debug.WriteLine("*********  Action Safe  *********");
#endif
                await ViewModel?.ActivateChatPromptAsync(ChatPromptType.SafetyCheck);

                var success = await ViewModel?.SendMessage(Resources.GetString(Resource.String.im_safe));

                break;

            default:
#if DEBUG
                System.Diagnostics.Debug.WriteLine("*********  Invalid Action  *********");
#endif
                LaunchRemoteNotificationRelpyActivity();
                break;
            }
            Finish();
        }