decodeUrlContent

The decodeUrlContent API is called by the super app to decode the URL that is generated from a promotion QR code.

Method signature

copy
public static synchronized void decodeUrlContent(final String url,
                                        final GriverDecodeUrlCallback callback);

Request parameters

Name

Type

Description

Required

url

String

The URL content to be decoded.

M

callback

GriverDecodeUrlCallback

The callback function that is invoked after the process ends.

M

Response parameters

N/A

Sample

The following sample shows how to call the decodeUrlContent API.

copy
GriverDecodeUrl.decodeUrlContent(uriContent, new GriverDecodeUrlCallback() {
     @Override
     public void onDecodeSuccess(String url) {
        //when decoding successed, you can open the url  
        //Bundle bundle = new Bundle();
        //Griver.openUrl(activity, url, bundle);
     }

      @Override
      public void onDecodeFailed(int errorCode, String errorMessage) {
        //when decoding failed, you can open the original uriContent      
        //Bundle bundle = new Bundle();
        //Griver.openUrl(activity, uriContent, bundle);
      }
});