Пример #1
0
 public Task <Firebase.Invites.SendInviteResult> SendInviteAsync()
 {
     Firebase.Invites.Invite invite = new Firebase.Invites.Invite()
     {
         TitleText        = "Invites Test App",
         MessageText      = "Please try my app! It's awesome.",
         CallToActionText = "Download it for FREE",
         DeepLinkUrl      = new System.Uri("http://google.com/abc"),
     };
     return(Firebase.Invites.FirebaseInvites.SendInviteAsync(
                invite).ContinueWith <Firebase.Invites.SendInviteResult>(HandleSentInvite));
 }
Пример #2
0
        // Initialization method.  Called after the state
        // is added to the stack.
        public override void Initialize()
        {
            if (CommonData.gameWorld.worldMap.mapId == StringConstants.DefaultMapId)
            {
                Debug.LogWarning("Error - Trying to share an unsaved map!");
                manager.PopState();
                return;
            }

            Firebase.Invites.Invite invite = new Firebase.Invites.Invite();

            invite.TitleText = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigInviteTitleText).StringValue;
            invite.MessageText = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigInviteMessageText).StringValue;
            invite.CallToActionText = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigInviteCallToActionText).StringValue;

            invite.EmailContentHtml = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigEmailContentHtml).StringValue;
            invite.EmailSubjectText = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigEmailSubjectText).StringValue;

            invite.DeepLinkUrl = new System.Uri(
                string.Format(StringConstants.DefaultInviteDeepLinkUrl,
                              CommonData.gameWorld.worldMap.mapId));

            Firebase.Invites.FirebaseInvites.SendInviteAsync(invite).ContinueWith(task => {
                isComplete = true;
                if (task.IsFaulted)
                {
                    Debug.LogError("Invite failed!\n" + task.Exception);
                }
                else
                {
                    Firebase.Analytics.FirebaseAnalytics.LogEvent(StringConstants.AnalyticsEventMapShared,
                                                                  StringConstants.AnalyticsParamMapId, CommonData.gameWorld.worldMap.mapId);
                    if (Social.localUser.authenticated)
                    {
                        Social.ReportProgress(GPGSIds.achievement_friendly_hamster, 100.0f, (bool success) => {
                            Debug.Log("Map sharing achievement unlocked. Sucess: " + success);
                        });
                    }
                    SetMapToShared();
                }
            });
        }
Пример #3
0
        // Initialization method.  Called after the state
        // is added to the stack.
        public override void Initialize()
        {
            if (CommonData.gameWorld.worldMap.mapId == StringConstants.DefaultMapId)
            {
                Debug.LogWarning("Error - Trying to share an unsaved map!");
                manager.PopState();
                return;
            }

            Firebase.Invites.Invite invite = new Firebase.Invites.Invite();

            invite.TitleText = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigInviteTitleText).StringValue;
            invite.MessageText = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigInviteMessageText).StringValue;
            invite.CallToActionText = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigInviteCallToActionText).StringValue;

            invite.EmailContentHtml = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigEmailContentHtml).StringValue;
            invite.EmailSubjectText = Firebase.RemoteConfig.FirebaseRemoteConfig.GetValue(
                StringConstants.RemoteConfigEmailSubjectText).StringValue;

            invite.DeepLinkUrl = new System.Uri(
                string.Format(StringConstants.DefaultInviteDeepLinkUrl,
                              CommonData.gameWorld.worldMap.mapId));

            Firebase.Invites.FirebaseInvites.SendInviteAsync(invite).ContinueWith(task => {
                isComplete = true;
                if (task.IsFaulted)
                {
                    Debug.LogError("Invite failed!\n" + task.Exception);
                }
                else
                {
                    Firebase.Analytics.FirebaseAnalytics.LogEvent(StringConstants.AnalyticsEventMapShared,
                                                                  StringConstants.AnalyticsParamMapId, CommonData.gameWorld.worldMap.mapId);
                    SetMapToShared();
                }
            });
        }