public static void DeepLinkToApplication(ulong appId, string packageName, string extraData = null,
                                          string roomId = null, DeepLinkErrorDelegate errorCallback = null,
                                          DeepLinkSuccessDelegate successCallback = null)
 {
     if (UseOculus)
     {
         OculusDeepLinkController.DeepLinkToApplication(appId, packageName, extraData, roomId, errorCallback, successCallback);
     }
     else
     {
         NativeDeepLinkController.DeepLinkToApplication(appId.ToString(), packageName, extraData, roomId);
     }
 }
Example #2
0
    public static void DeepLinkToApplication(ulong appId, string packageName, string extraData = null, string roomId = null, DeepLinkErrorDelegate errorCallback = null, DeepLinkSuccessDelegate successCallback = null)
    {
        LaunchingOtherApp = true;

        DeepLinkData data = new DeepLinkData();

        data.SenderAppId       = GetAppIDFromConfig();
        data.ExtraData         = extraData;
        data.MultiplayerRoomId = roomId;

#if !UNITY_EDITOR
        data.DeviceId = GetAndroidDeviceID();
#endif

#if !UNITY_EDITOR
        if (packageName.Contains("vrhealth"))
        {
            data.ExtraData = data.ExtraData + ";" + GetAndroidDeviceID();
        }
#endif

        var options = new ApplicationOptions(); options.SetDeeplinkMessage(JsonConvert.SerializeObject(data));
        Oculus.Platform.Application.LaunchOtherApp(appId, options).OnComplete(delegate(Message <string> message)
        {
            if (message.IsError)
            {
                Debug.Log("Error launching other app: " + message.GetError().Message);
                LaunchingOtherApp = false;
                if (errorCallback != null)
                {
                    errorCallback(message.GetError().Message);
                }
            }
            else
            {
                if (successCallback != null)
                {
                    successCallback(message.Data);
                }
            }
        });
    }