Skip to content

Commit 36ded7e

Browse files
committed
App Metadata can be set from the ThirdwebManager inspector
1 parent 77c1b52 commit 36ded7e

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

Assets/Thirdweb/Examples/Prefabs/ThirdwebManager.prefab

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ MonoBehaviour:
8888
- identifier: binance-testnet
8989
chainId: 97
9090
rpcOverride:
91+
appName: Thirdweb Game
92+
appDescription: Thirdweb Game Demo
93+
appIcons:
94+
- https://thirdweb.com/favicon.ico
95+
appUrl: https://thirdweb.com
9196
storageIpfsGatewayUrl: https://gateway.ipfscdn.io/ipfs/
9297
relayerUrl:
9398
relayerForwarderAddress:

Assets/Thirdweb/Examples/Scripts/Prefabs/ThirdwebManager.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,21 @@ public class ThirdwebManager : MonoBehaviour
4343
new ChainData("binance-testnet", "97", null),
4444
};
4545

46+
[Header("APP METADATA")]
47+
public string appName = "Thirdweb Game";
48+
public string appDescription = "Thirdweb Game Demo";
49+
public string[] appIcons = new string[] { "https://thirdweb.com/favicon.ico" };
50+
public string appUrl = "https://thirdweb.com";
51+
4652
[Header("STORAGE OPTIONS")]
4753
[Tooltip("IPFS Gateway Override")]
4854
public string storageIpfsGatewayUrl = "https://gateway.ipfscdn.io/ipfs/";
4955

5056
[Header("OZ DEFENDER OPTIONS")]
51-
[Tooltip("Gasless Transaction Support")]
57+
[Tooltip("Autotask URL")]
5258
public string relayerUrl = null;
59+
60+
[Tooltip("Forwarders can be found here https://github.com/thirdweb-dev/ozdefender-autotask")]
5361
public string relayerForwarderAddress = null;
5462

5563
public ThirdwebSDK SDK;
@@ -124,6 +132,16 @@ private void Awake()
124132
};
125133
}
126134

135+
// Set up app metadata
136+
137+
options.wallet = new ThirdwebSDK.WalletOptions()
138+
{
139+
appName = string.IsNullOrEmpty(appName) ? "Thirdweb Game" : appName,
140+
appDescription = string.IsNullOrEmpty(appDescription) ? "Thirdweb Game Demo" : appDescription,
141+
appIcons = appIcons.Length == 0 ? new string[] { "https://thirdweb.com/favicon.ico" } : appIcons,
142+
appUrl = string.IsNullOrEmpty(appUrl) ? "https://thirdweb.com" : appUrl
143+
};
144+
127145
SDK = new ThirdwebSDK(chainOrRPC, chainId, options);
128146
}
129147

0 commit comments

Comments
 (0)