ARGear SDK Documentations
  • Introduction
  • Android
    • 1. Quickstart
    • 2. Configuration Settings
    • 3. ARGear Overview
    • 4. ARGSession
    • 5. Camera
    • 6. Rendering
    • 7. CMS Service
    • 8. Download Contents
    • 9. Set Contents
    • 10. Media
    • 11. Switch Camera Face
    • 12. Enable Debugging Mode
    • 13. ARCore Connect API
    • 14. API Reference
  • iOS
    • 1. Quickstart
    • 2. Configuration Settings
    • 3. ARGear Overview
    • 4. ARGSession
    • 5. Camera
    • 6. Rendering
    • 7. CMS Service
    • 8. Download Contents
    • 9. Set Contents
    • 10. Media
    • 11. Switch Camera Face
    • 12. Enable Debugging Mode
    • 13. ARKit Connect API
    • 14. API Reference
  • Unity
    • 1. Quickstart
    • 2. Configuration Settings
    • 3. ARGear Plugin Overview
    • 4. ARGearManager
    • 5. ARGearCamera
    • 6. CMS Service
    • 7. Download Contents
    • 8. Set Contents
    • 9. Switch Camera Face
    • 10. Enable Debugging Mode
    • 11. API Reference
Powered by GitBook
On this page

Was this helpful?

  1. Android

8. Download Contents

You can download content's zip_file through the REST API, using each content download URL. For the zip_file URL, you need to first request a signed URL.

The signed URL can be generated through ARGSession.auth().requestSignedUrl and be obtained by calling ARGAuth.Callback(). Using this URL, you can download contents.

Below is sample code to generate the signed URL.

argsession.auth().requestSignedUrl(item.zipFileUrl, item.title, item.type, new ARGAuth.Callback() {

    @Override
    public void onSuccess(String url) {
        // Using obtained signed url, request download.
        requestDownload(path, url, item.uuid, isArItem);
    }

    @Override
    public void onError(Throwable e) {
        if (e instanceof SignedUrlGenerationException) {
            Log.e(TAG, "SignedUrlGenerationException !! ");
        } else if (e instanceof NetworkException) {
            Log.e(TAG, "NetworkException !!");
        }
    }

});
argsession.auth().requestSignedUrl(item.zipFileUrl, item.title, item.type, object : ARGAuth.Callback {

    override fun onSuccess(url: String) {
        // Using obtained signed url, request download.
        requestDownload(path, url, item, isArItem)
    }

    override fun onError(e: Throwable) {
        if (e is SignedUrlGenerationException) {
            Log.e(TAG, "SignedUrlGenerationException !! ")
        } else if (e is NetworkException) {
            Log.e(TAG, "NetworkException !!")
        }
    }
    
})

Previous7. CMS ServiceNext9. Set Contents

Last updated 5 years ago

Was this helpful?