Skip to content

Commit

Permalink
feat: Update the onAppSessionStart documtation
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanenadi committed Sep 22, 2023
1 parent fae09e9 commit 5eeeef1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,17 @@ export default function App() {
session starts (user sign-in/sign-up, app refresh, etc.). It can be used for
analytics purposes, checking subscription status, etc.

`onAppSessionStart` is invoked with an object containing a `resumeAppSession`.
The app session will be paused until `resumeAppSession` is invoked.

````typescript
```typescript
import React, { FC } from 'react';
import { authConfig } from './authConfig';
import { RootProviders, RootStack } from '@lifeomic/react-native-sdk';
import { RootProviders, RootStack, OnAppSessionStartParams } from '@lifeomic/react-native-sdk';
export default function App() {
const onAppSessionStart = async (resumeAppSession: () => void) => {
const onAppSessionStart = async ({ resumeAppSession }: OnAppSessionStartParams) => {
// track app session start metric
await trackAppSessionStart();
resumeAppSession();
Expand Down
2 changes: 1 addition & 1 deletion src/common/DeveloperConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export type Navigator<
React.ComponentType<Props>
>;

type OnAppSessionStartParams = {
export type OnAppSessionStartParams = {
resumeAppSession: () => void;
};

Expand Down

0 comments on commit 5eeeef1

Please sign in to comment.