https://github.com/txthinking/codeinstall
https://github.com/txthinking/codeinstall
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/txthinking/codeinstall
- Owner: txthinking
- Created: 2021-12-04T08:18:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-22T05:03:18.000Z (over 3 years ago)
- Last Synced: 2025-02-09T05:24:29.002Z (about 1 year ago)
- Language: HTML
- Size: 62.8 MB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
https://www.txthinking.com/codeinstall.html
## Web
1. import codeinstall.js
```
```
2. Example
```
Loading...
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();
```
## Android
1. Download SDK: [codeinstallsdk.aar](codeinstallsdk.aar)
Tips:targetSdkVersion <= 29
2. 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) {
//
}
```
## iOS
1. Download SDK: [Codeinstallsdk.framework](Codeinstallsdk.framework.zip)
2. 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
```