void InitCallback(Message <PlatformInitialize> msg)
    {
        if (msg.IsError)
        {
            TerminateWithError(msg);
            return;
        }

        LaunchDetails launchDetails = ApplicationLifecycle.GetLaunchDetails();

        SocialPlatformManager.LogOutput("App launched with LaunchType " + launchDetails.LaunchType);

        // First thing we should do is perform an entitlement check to make sure
        // we successfully connected to the Oculus Platform Service.
        Entitlements.IsUserEntitledToApplication().OnComplete(IsEntitledCallback);
    }
Beispiel #2
0
    /**
     * Getting the deeplink information off the app launch details. When a user requests
     * to travel to a destination from outside your app, their request will be found here
     * Get the info to bring the user to the expected destination.
     */
    string GetAppLaunchDetails()
    {
        var launchDetails = ApplicationLifecycle.GetLaunchDetails();

        // The other users this user expect to see after traveling to the destination
        // If there is conflicting data between the inputted users and destination,
        // favor using the users.
        // For example, if user A & destination 1 was passed in, but user A is now
        // in destination 2, it is better to bring the current user to destination 2
        // if possible.
        var users      = launchDetails.UsersOptional;
        var usersCount = (users != null) ? users.Count : 0;

        // The deeplink message, this should give enough info on how to go the
        // destination in the app.
        var deeplinkMessage = launchDetails.DeeplinkMessage;

        // The API Name of the destination. You can set the user to this after
        // navigating to the app
        var destinationApiName = launchDetails.DestinationApiName;

        TrackingID = !string.IsNullOrEmpty(launchDetails.TrackingID) ? launchDetails.TrackingID : "FakeTrackingID";

        var detailsString = "-Deeplink Message:\n" + deeplinkMessage + "\n-Api Name:\n" + destinationApiName + "\n-Users:\n";

        if (usersCount > 0)
        {
            foreach (var user in users)
            {
                detailsString += user.OculusID + "\n";
            }
        }
        else
        {
            detailsString += "null\n";
        }
        detailsString += "\n";
        return(detailsString);
    }