https://www.txthinking.com/codeinstall.html
-
import codeinstall.js
<script src="https://cdn.jsdelivr.net/gh/txthinking/codeinstall@master/codeinstall.js"></script>
-
Example
<html> <head> <script src="https://cdn.jsdelivr.net/gh/txthinking/codeinstall@master/codeinstall.js"></script> </head> <body> <button id="download" style="font-size:100px;">Loading...</button> </body> <script> async function a(){ try{ var link = await CodeInstall('APPID'); document.querySelector('#download').innerText = "Download"; document.querySelector('#download').addEventListener('click', ()=>{ location.href = link; }); }catch(e){ alert(`${e}`); } } a(); </script> </html>
-
Download SDK: codeinstallsdk.aar
Tips:targetSdkVersion <= 29
-
Example
import codeinstallsdk.Codeinstallsdk; import android.os.Build; ... try{ Codeinstallsdk.init(); String code = Codeinstallsdk.get("APPID", Build.VERSION.RELEASE, Build.MODEL); // code comes from the web; or empty string if expired or not found; please cache it } catch (Exception e) { // }
-
Download SDK: Codeinstallsdk.framework
-
Example
import Codeinstallsdk import UIKit ... CodeinstallsdkInit() var err: NSError? = nil var code = CodeinstallsdkGet("APPID", UIDevice.current.systemVersion, "iPhone", &err) if err != nil { // return } // code comes from the web; or empty string if expired or not found; please cache it