Skip to content

Commit 1941bbe

Browse files
Merge pull request #144 from immutable/docs/dx-3340
docs: add documentation to passport methods (#3340)
2 parents 039edd3 + 715efb0 commit 1941bbe

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

Source/Immutable/Public/Immutable/ImmutableDataTypes.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct IMMUTABLE_API FImmutablePassportInitData
4646
{
4747
GENERATED_BODY()
4848

49-
/** The Client Id. */
49+
/** The Client ID. */
5050
UPROPERTY()
5151
FString clientId;
5252

@@ -65,7 +65,10 @@ struct IMMUTABLE_API FImmutablePassportInitData
6565
UPROPERTY()
6666
FString environment = ImmutablePassportAction::EnvSandbox;
6767

68-
/** Whether silent logout is enabled. */
68+
/**
69+
* Whether silent logout is enabled.
70+
* If true, logout silently (without popping up a new browser tab)
71+
*/
6972
UPROPERTY()
7073
bool isSilentLogout = false;
7174

Source/Immutable/Public/Immutable/ImmutablePassport.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,18 @@ class IMMUTABLE_API UImmutablePassport : public UObject
8787
* This will open the user's default browser and take them through Passport login.
8888
* @param IsConnectImx If true, the "re-connect" method is used to authenticate into Passport with Immutable X.
8989
* Else, "re-login" is used for authentication. To access a wallet with Immutable X or zkEVM later, you must call "Connect" again with this value set to true, or use "ConnectEvm."
90-
* @param TryToRelogin If true, the game bridge will use a cached session to re-connect or re-login the user, avoiding the need for a web browser. If this attempt fails, it will fall back to device code authentication.
90+
* @param TryToRelogin If true, the game bridge will use a cached session to re-connect or re-login the user, avoiding the need to open a web browser. If this attempt fails, it will fall back to device code authentication.
9191
* @param ResponseDelegate Callback delegate.
9292
*/
9393
void Connect(bool IsConnectImx, bool TryToRelogin, const FImtblPassportResponseDelegate& ResponseDelegate);
9494
#if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC
95+
/**
96+
* (Android, iOS and macOS only) Logs into Passport using Authorisation Code Flow with Proof Key for Code Exchange (PKCE)
97+
*
98+
* @param IsConnectImx If true, player will go through the device code auth login flow and connect to Immutable X.
99+
* Else, initiate only the device auth login flow.
100+
* @param ResponseDelegate Callback delegate.
101+
*/
95102
void ConnectPKCE(bool IsConnectImx, const FImtblPassportResponseDelegate& ResponseDelegate);
96103
#endif
97104

@@ -277,7 +284,7 @@ class IMMUTABLE_API UImmutablePassport : public UObject
277284
void HandleCustomTabsDismissed(FString Url);
278285
#elif PLATFORM_IOS | PLATFORM_MAC
279286
/**
280-
* Handle deep linking. This is called from Objective-C.
287+
* Handle deep linking. This is called from iOS/Mac native code.
281288
*
282289
* @param DeepLink The deep link URL, passed from the iOS/Mac. This string contains the deep link data to be processed.
283290
*/
@@ -325,12 +332,12 @@ class IMMUTABLE_API UImmutablePassport : public UObject
325332
void ReinstateConnection(FImtblJSResponse Response);
326333

327334
/**
328-
* Checks if the passport has been initialised before allowing an action to proceed.
335+
* Checks if Passport has been initialised before allowing an action to proceed.
329336
*
330337
* @param Action The name of the JavaScript action to be called. Used for logging purposes.
331338
* @param ResponseDelegate Delegate to handle the response if the passport is not initialised.
332339
*
333-
* @return True if the passport is initialised, otherwise, false.
340+
* @return True if Passport is initialised, otherwise, false.
334341
*/
335342
bool CheckIsInitialized(const FString& Action, const FImtblPassportResponseDelegate& ResponseDelegate) const;
336343

@@ -435,7 +442,8 @@ class IMMUTABLE_API UImmutablePassport : public UObject
435442
void CallJniStaticVoidMethod(JNIEnv* Env, const jclass Class, jmethodID Method, ...);
436443

437444
/**
438-
* Launches a URL on Android using JNI.
445+
* Opens a specified URL on Android using Chrome Custom Tabs via JNI if Chrome is installed.
446+
* Else, it launches the URL in any available browser.
439447
*
440448
* @param Url The URL to launch.
441449
*/
@@ -489,7 +497,7 @@ class IMMUTABLE_API UImmutablePassport : public UObject
489497

490498
private:
491499
/**
492-
* Saves the current passport settings to save game object.
500+
* Saves the current Passport settings to save game object.
493501
*/
494502
void SavePassportSettings();
495503

0 commit comments

Comments
 (0)