Beispiel #1
0
        /// <summary>
        /// Tracks this application being launched. If the LaunchActivatedEventArgs
        /// parameter contains push data passed through from a Toast's "launch"
        /// parameter, then we extract and report information to correlate this
        /// application open with that push.
        /// </summary>
        /// <param name="launchArgs">The LaunchActivatedEventArgs available in an
        /// Application.OnLaunched override.</param>
        /// <returns>An Async Task that can be waited on or ignored.</returns>
        public static Task TrackAppOpenedAsync(ILaunchActivatedEventArgs launchArgs)
        {
            // Short-circuit if the Launch event isn't from an actual app launch.
            // We'll still phone home if the launchArgs passed in is null, though,
            // so here we only check for a non-Launch ActivationKind.
            if (launchArgs != null && launchArgs.Kind != ActivationKind.Launch)
            {
                return(((Task)null).Safe());
            }

            object pushHash;
            IDictionary <string, object> contentJson = AVPush.PushJson(launchArgs);

            contentJson.TryGetValue("push_hash", out pushHash);
            return(AVAnalytics.TrackAppOpenedWithPushHashAsync((string)pushHash));
        }
 /// <summary>
 /// Tracks this application being launched.
 /// </summary>
 /// <returns>An Async Task that can be waited on or ignored.</returns>
 public static Task TrackAppOpenedAsync()
 {
     return(AVAnalytics.TrackAppOpenedWithPushHashAsync());
 }