diff --git a/types/facebook-instant-games/facebook-instant-games-tests.ts b/types/facebook-instant-games/facebook-instant-games-tests.ts index 949782c41a..6223c3d5e3 100644 --- a/types/facebook-instant-games/facebook-instant-games-tests.ts +++ b/types/facebook-instant-games/facebook-instant-games-tests.ts @@ -1,5 +1,5 @@ const locale: string = FBInstant.getLocale()!; -const platform: string = FBInstant.getPlatform(); +const platform: string = FBInstant.getPlatform()!; const sdkVersion: string = FBInstant.getSDKVersion(); FBInstant.initializeAsync().then(() => {}); FBInstant.setLoadingProgress(10); diff --git a/types/facebook-instant-games/index.d.ts b/types/facebook-instant-games/index.d.ts index 74c93c6c96..2e6da873cd 100644 --- a/types/facebook-instant-games/index.d.ts +++ b/types/facebook-instant-games/index.d.ts @@ -33,7 +33,7 @@ declare namespace FBInstant { /** * The platform on which the game is currently running. The value will always be null until FBInstant.initializeAsync() resolves. */ - function getPlatform(): Platform; + function getPlatform(): Platform | null; /** * The string representation of this SDK version. @@ -458,7 +458,7 @@ declare namespace FBInstant { * @throws PENDING_REQUEST * @throws CLIENT_UNSUPPORTED_OPERATION */ - chooseAsync(options: ContextOptions): Promise; + chooseAsync(options?: ContextOptions): Promise; /** * Attempts to create or switch into a context between a specified player and the current player. The returned promise will reject if the player listed is not a Connected Player of the current @@ -521,7 +521,7 @@ declare namespace FBInstant { * @throws INVALID_OPERATION * @throws RATE_LIMITED */ - setScoreAsync(score: number, extraData: string): Promise; + setScoreAsync(score: number, extraData?: string): Promise; /** * Retrieves the leaderboard's entry for the current player, or null if the player has not set one yet.