Ejemplo n.º 1
0
        public static async Task <string> RegisterForPush(ISwrveCommon sdk)
        {
            SwrvePush push = GetPush();

            push.SetCommonSDK(sdk);
            await push.UpdateUriAsync();

            string uri;

            push.GetStoredUri(out uri);
            return(uri);
        }
Ejemplo n.º 2
0
        public static void ShowConversation(ISwrveCommon sdk, object conversationJson)
        {
            if (conversationJson is string)
            {
                conversationJson = JsonObject.Parse((string)conversationJson);
            }
            else if (!(conversationJson is JsonObject))
            {
                SwrveLog.e(string.Format("Unable to handle object of type {0} for ShowConversation", (conversationJson == null ? "null" : "" + conversationJson.GetType())));
                return;
            }

            string os = AnalyticsInfo.VersionInfo.DeviceFamily.ToLower();
            SwrveConversationUI conversationUI = new SwrveConversationUI(sdk, os.Contains("desktop"));

            SwrveConversation conversation = new SwrveConversation(new SwrveConversationCampaign(), (JsonObject)conversationJson);

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            conversationUI.PresentConversation(sdk, conversation);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
        }