diff --git a/js-miniapp-sdk/CHANGELOG.md b/js-miniapp-sdk/CHANGELOG.md index e279fa10..999af03a 100644 --- a/js-miniapp-sdk/CHANGELOG.md +++ b/js-miniapp-sdk/CHANGELOG.md @@ -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 diff --git a/js-miniapp-sdk/README.md b/js-miniapp-sdk/README.md index e2fac61e..569ba64c 100644 --- a/js-miniapp-sdk/README.md +++ b/js-miniapp-sdk/README.md @@ -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 @@ -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) @@ -1424,6 +1434,124 @@ MiniApp.miniappUtils ``` +
+ +## Launch Internal browser Available from v1.22.0 + +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); + }); + +``` + + + +## Launch External browser Available from v1.22.0 + +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); + }); + +``` + + + +## Get Image from Gallery Available from v1.22.0 + +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; +} + +``` + + + +## Get User Login status Available from v1.22.0 + +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); + }); + +``` + + + + +## Enable/Disable Navigation Gestures Available from v1.22.0 + +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