To setup the client you need to configure it with your projectId
which you can obtain from Reown Cloud.
Furthermore you may need to configure the domain
and isLimited
parameters:
domain
defaults to window.location.host
and must be set to the domain setup in Cloud Setup. For example app.example.com
. Do not add the scheme (https://
).allApps
determines if your app has access to all of the user’s subscriptions, or only the ones that the app is hosted on. By setting it to true
, it enables setting domain
to a value other than window.location.host
. Setting allApps: true
can be useful during development to allow your localhost-deployed app to access the subscriptions for the domain you setup. Note that most apps do not need to set this in production environments, as they only need access to their own subscriptions. When enabled, the user has to sign a SIWE message granting your app more permissions, and this requires additional consideration from the user.window.location.host
.false
to request access to all of the user’s notification subscriptions for all apps, instead of only domain
. Defaults to true
.Note: EIP-1271 signatures coming from smart wallets are supported in version 1.1.0
and above.
Some suggested methods of signing the message:
Wallet.signMessage
method@wagmi/core
signMessage
methoduseSignMessage
hook in @wagmi
Subscribe, Unsubscribe, Get Subscription, Check if Subscribed.
When using differentAccount
, the passed account needs to be previously registered.
This use case is for Dapps that have multiple active accounts or wallets with multiple active accounts.
differentAccount
can be used for all the below hooks and functions that accept account
You can retrieve notifications using pagination. One approach is to provide the last notification’s ID as the starting point:
true
, since 1.3.0) Whether or not unread messages should be sorted at the top, regardless of timestamp(enabledScopeNames: string[]) -> void
If you wish to receive live push notifications to your React Native or Web app, you must integrate with Firebase Messaging. More information about how to integrate with Firebase can be found here.
Your integration will obtain a token from Firebase and you will need to pass this token to the Web3Inbox SDK using the registerWithPushServer()
function.
registerWithPushServer
: (token: string, platform: 'fcm' | 'apns') => string
Either APNS or FCM can be used to receive push notifications. Token here is the respective platform’s token.
This can be used to listen to, for example, messages received in realtime.
message
: Notification of type:To setup the client you need to configure it with your projectId
which you can obtain from Reown Cloud.
Furthermore you may need to configure the domain
and isLimited
parameters:
domain
defaults to window.location.host
and must be set to the domain setup in Cloud Setup. For example app.example.com
. Do not add the scheme (https://
).allApps
determines if your app has access to all of the user’s subscriptions, or only the ones that the app is hosted on. By setting it to true
, it enables setting domain
to a value other than window.location.host
. Setting allApps: true
can be useful during development to allow your localhost-deployed app to access the subscriptions for the domain you setup. Note that most apps do not need to set this in production environments, as they only need access to their own subscriptions. When enabled, the user has to sign a SIWE message granting your app more permissions, and this requires additional consideration from the user.window.location.host
.false
to request access to all of the user’s notification subscriptions for all apps, instead of only domain
. Defaults to true
.Note: EIP-1271 signatures coming from smart wallets are supported in version 1.1.0
and above.
Some suggested methods of signing the message:
Wallet.signMessage
method@wagmi/core
signMessage
methoduseSignMessage
hook in @wagmi
Subscribe, Unsubscribe, Get Subscription, Check if Subscribed.
When using differentAccount
, the passed account needs to be previously registered.
This use case is for Dapps that have multiple active accounts or wallets with multiple active accounts.
differentAccount
can be used for all the below hooks and functions that accept account
You can retrieve notifications using pagination. One approach is to provide the last notification’s ID as the starting point:
true
, since 1.3.0) Whether or not unread messages should be sorted at the top, regardless of timestamp(enabledScopeNames: string[]) -> void
If you wish to receive live push notifications to your React Native or Web app, you must integrate with Firebase Messaging. More information about how to integrate with Firebase can be found here.
Your integration will obtain a token from Firebase and you will need to pass this token to the Web3Inbox SDK using the registerWithPushServer()
function.
registerWithPushServer
: (token: string, platform: 'fcm' | 'apns') => string
Either APNS or FCM can be used to receive push notifications. Token here is the respective platform’s token.
This can be used to listen to, for example, messages received in realtime.
message
: Notification of type: