cancel
Showing results for 
Search instead for 
Did you mean: 

How to test In-app update Platform SDK APIs in Unity

Hello, I am reading through this documentation: In-App Update API and it seems pretty straightforward but there is no information on how to test this implementation. Here's what I wrote (mostly copied from the docs) and I just need to confirm if this is all to ship the app with In-App Update API. On a side note, is there any API to request user to write review on the store something like Google has with their Google Play In-App-Review ?

first we run init on app launch:

Core.AsyncInitialize(APP_ID).OnComplete(msg => {})

and then check for update:

            var request = Oculus.Platform.Application.GetVersion();
            request.OnComplete(
              async message => {
                  if (message.IsError)
                  {
                      return;
                  }
                  var currentVersionCode = message.Data.CurrentCode;
                  var latestVersionCode = message.Data.LatestCode;
                  if (currentVersionCode != latestVersionCode)
                  {
                      //need to convert this request into Task 
                      bool shouldContinue = await ShowUpdateDialogAsync();
                      if (!shouldContinue)
                      {
                          return;
                      }

                      Oculus.Platform.Application.StartAppDownload().OnComplete((Oculus.Platform.Message<Oculus.Platform.Models.AppDownloadResult> message) => {
                          //need to convert this request into Task 
                          if (message.IsError)
                          {
                              return;
                          }
                          else
                          {
                              var appOptions = new ApplicationOptions();


                              Oculus.Platform.Application.InstallAppUpdateAndRelaunch(appOptions).OnComplete((Oculus.Platform.Message<Oculus.Platform.Models.AppDownloadResult> message) => {
                                  if (message.IsError)
                                  {
                                      return;
                                  }
                                  //guessing app should relauch automatically at this point so no action needed. 
                              });
                          }
                      });

                  }
              }
             );

 let me know if this much implementation is enough to update and relaunch the app after the update completes?

0 REPLIES 0