Skip to content

Commit

Permalink
Update Documentation & Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
rleojoseph committed Dec 5, 2024
1 parent f336937 commit 612a94d
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 2 deletions.
10 changes: 10 additions & 0 deletions js-miniapp-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## CHANGELOG

### 1.22.0 (2024-12-05)
- **Feature:** Added new interface `launchExternalBrowser` which helps the MiniApps to launch a URL in external browser
- **Feature:** Added new interface `launchInternalBrowser` which helps the MiniApps to launch a URL in internal browser
- **Feature:** Added new interface `getImageFromGallery` to get image from Gallery. User can select one image and the same will be returned to MiniApp
- **Feature:** Added new interface `isLoggedIn` to get the Login status of the User in the Host application
- **Feature:** Added new interface `allowBackForwardNavigationGestures` to enable/disable swipe gestures in iOS Host application
- **Update:** Update `shareInfo` to allow sharing URL & Image as well

---

### 1.21.0 (2024-07-30)
- **Feature:** Added new interface `isAppDeeplinkSupported` which helps to check if the application have whitelisted/allows the deeplink to open
- **Feature:** Added new interface `canOpenAppDeeplink` which helps to check if the device can open the deeplink scheme
Expand Down
132 changes: 130 additions & 2 deletions js-miniapp-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ Here is the example of manifest. You can also see [it](https://github.com/rakute
- [Get Feature list](#get-feature-list)
- [Can open App Deeplink](#can-open-app-deeplink)
- [App supports deeplink](#is-app-deeplink-supported)
- [Launch Internal browser](#launch-internal-browser)
- [Launch External browser](#launch-external-browser)
- [Get Image from Gallery](#get-image-from-gallery)
- [Enable/Disable Navigation Gestures](#enable-disable-navigation-gestures)
- [Get User Login status](#is-loggedIn)
## User details
Expand Down Expand Up @@ -498,10 +502,16 @@ It is possible for the mini app user to share data with another App by showing t
The data format must match the [ShareInfoType](api/interfaces/shareinfotype.md).
NOTE: URL & Image support is added from v1.22.0
```javascript
import MiniApp from 'js-miniapp-sdk';

const info = { content: inputValue };
const info = {
content: inputValue,
url: url,
imageBlob: blob,
};

MiniApp
.shareInfo(info)
Expand Down Expand Up @@ -1424,6 +1434,124 @@ MiniApp.miniappUtils

```
<div id='launch-internal-browser'/>
## Launch Internal browser <small style="color:green;font-size: 12px">Available from v1.22.0</small>
This interface will help the MiniApps to launch URL in internal browser
```javascript
import MiniApp from 'js-miniapp-sdk';

MiniApp.miniappUtils
.launchInternalBrowser(url)
.then((response) => {
console.log(response);
})
.catch((miniAppError) => {
console.log(miniAppError);
});

```
<div id='launch-external-browser'/>
## Launch External browser <small style="color:green;font-size: 12px">Available from v1.22.0</small>
This interface will help the MiniApps to launch URL in External browser
```javascript
import MiniApp from 'js-miniapp-sdk';

MiniApp.miniappUtils
.launchExternalBrowser("https:///www.rakuten.co.jp")
.then((response) => {
console.log(response);
})
.catch((miniAppError) => {
console.log(miniAppError);
});

```
<div id='get-image-from-gallery'/>
## Get Image from Gallery <small style="color:green;font-size: 12px">Available from v1.22.0</small>
This interface will help you to launch the gallery directly and user can select the image and the same image will be returned.
```javascript
import MiniApp from 'js-miniapp-sdk';

MiniApp.galleryManager
.getImageFromGallery()
.then((response) => {
console.error('Success');
})
.catch((error) => {
console.error('Error selecting image from gallery:', error);
});

```
Please note that the response will be of GalleryFileResponse
```javascript
/**
* Represents a file in the gallery.
*/
export interface GalleryFileResponse {
/** The name of the file (optional). */
filename?: string;
/** The binary data of the file. */
data: Blob;
}

```
<div id='is-loggedIn'/>
## Get User Login status <small style="color:green;font-size: 12px">Available from v1.22.0</small>
This interface will help the MiniApps to know if the User is logged in.
```javascript
import MiniApp from 'js-miniapp-sdk';

MiniApp.user
.isLoggedIn()
.then((response) => {
console.log(response);
})
.catch((miniAppError) => {
console.log(miniAppError);
});

```
<div id='enable-disable-navigation-gestures'/>
## Enable/Disable Navigation Gestures <small style="color:green;font-size: 12px">Available from v1.22.0</small>
This interface will help the MiniApps to enable/disable the forward/back navigation gestures in iOS
```javascript
import MiniApp from 'js-miniapp-sdk';

MiniApp.webviewManager
.allowBackForwardNavigationGestures(false)
.then((response) => {
console.log('Updated');
})
.catch((error) => {
console.log('Error: ', error);
});

```
## Advanced Usage
<dl>
Expand Down

0 comments on commit 612a94d

Please sign in to comment.