0.3.6 • Published 5 years ago

@appyourself/widget-mobile-app-service v0.3.6

Weekly downloads
14
License
MIT
Repository
-
Last release
5 years ago

AppYourself Mobile App Widget

Javascript module, which allows an iFrame to communicate with AppYourself app (both native and webapp).

Usage

Using ES6 module

import { MobileAppService } from '@appyourself/widget-mobile-app-service';
...
// get user id
const userId: string = await MobileAppService.getUserId();

// set custom data
await MobileAppService.setUserData('customDataKey', 'lorem ipsum');

// read custom data, should setup `lorem ipsum` string
const customUserData: string = await MobileAppService.getUserData('customDataKey');

Use JSON.stringify and JSON.parse if you want to get/set the whole object at once.

API

  • static isActive(): Promise<boolean> - Check if the app is responding.

  • static getUserId(): Promise<string> - Get the unique mobile app user id.

  • static getUserData(key: string): Promise<string> - Get any custom user data, that has already been persisted by the website.

  • static setUserData(key: string, value: string): Promise<void> - Set any custom user data. The maximum size of a key is 1500 bytes, where the value can reach the max of 1,048,576 bytes (~ 1 MB).

Debug mode

All methods contain a debug boolean flag, that can be enabled to log communication details. Don't use on production!

await MobileAppService.isActive(true);
await MobileAppService.getUserId(true);

Further help

Please contact our support AppYourself Support.

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago