protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            Log.Debug(Tag, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);

            if (requestCode == RequestInvite)
            {
                if (resultCode == Result.Ok)
                {
                    var ids = AppInviteInvitation.GetInvitationIds((int)resultCode, data);
                    Log.Debug(Tag, ids.Length.ToString() + GetString(Resource.String.sent_invitations_fmt));
                }
                else
                {
                    // Sending failed or it was canceled, show failure message to the user
                    ShowMessage(GetString(Resource.String.send_failed));
                }
            }
        }
Example #2
0
        // [END on_invite_clicked]

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            Console.WriteLine(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);

            if (requestCode == REQUEST_INVITE)
            {
                if (resultCode == Result.Ok)
                {
                    // Get the invitation IDs of all sent messages
                    string[] ids = AppInviteInvitation.GetInvitationIds((int)resultCode, data);
                    Console.WriteLine(TAG, "onActivityResult: sent invitation " + ids);
                }
                else
                {
                    // Sending failed or it was canceled, show failure message to the user
                    // [START_EXCLUDE]
                    ShowMessage(GetString(Resource.String.send_failed));
                    // [END_EXCLUDE]
                }
            }
        }
        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);

            Log.Debug(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);

            if (requestCode == REQUEST_INVITE)
            {
                if (resultCode == Result.Ok)
                {
                    // Check how many invitations were sent and log a message
                    // The ids array contains the unique invitation ids for each invitation sent
                    // (one for each contact select by the user). You can use these for analytics
                    // as the ID will be consistent on the sending and receiving devices.
                    var ids = AppInviteInvitation.GetInvitationIds((int)resultCode, data);

                    Log.Debug(TAG, string.Format("You Sent {0} App Invitations!", ids.Length));
                }
                else
                {
                    // Sending failed or it was canceled, show failure message to the user
                    Toast.MakeText(this, "Failed to send App Invitations :(", ToastLength.Short).Show();
                }
            }
            else if (requestCode == RESOLUTION_CODE)
            {
                if (resultCode == Result.Ok)
                {
                    googleApiClient.Connect();
                }
                else
                {
                    Toast.MakeText(this, "Failed to Connect to Google Play Services", ToastLength.Long).Show();
                }
            }
        }