Application Context

getApplicationContext

import {getApplicationContext} from 'react-native-watch-connectivity';

const context = await getApplicationContext();

console.log(context);

TypeScript Support

import {getApplicationContext} from 'react-native-watch-connectivity';

type MyApplicationContext = {
    myKey: string
}

const context = await getApplicationContext<MyApplicationContext>();

console.log(context.myKey);

updateApplicationContext

import {updateApplicationContext} from 'react-native-watch-connectivity';

await updateApplicationContext({key: "value"});

TypeScript Support

import {updateApplicationContext} from 'react-native-watch-connectivity';

type MyApplicationContext = {
    myKey: string
}

await updateApplicationContext<MyApplicationContext>({key: "value"}); // Type error