Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Process to setup iOS push notification certificates to receive notification from AmitySDK / AmityUIKit.
In order to send or receive push notifications using our SDK, you would need to create push notification certificates from Apple Developer Console & Upload in our Amity console.
Here are the steps to generate push notification certificate from Apple Developer Console.
When a new .p12 certificate is created, previous certificate gets revoked and cannot be used again.
Step 1:
Go to Apple Developer Console (i.e https://developer.apple.com) and click on Certificates.
Step 2:
Select Apple Push Notification Service SSL (Sandbox & Production)
This certificate will be applicable for both Sandbox & Production environments so you do not need to create a separate for each one.
Step 3:
Follow the rest of the steps of creating certificates as shown by apple & download the .cer file.
Step 4:
Double click on .cer file you downloaded in the last step in Finder. After few seconds, Keychain Access program should open.
Step 5:
Select Login → My Certificates, then right click on the Apple Push Services certificate that you just installed. It would show you with some options as shown below.
Step 6:
Select Export “Apple Push Services …” option and save the file using .p12 extension. If you add a password while exporting, you will need to enter the same password in Amity Console.
Step 7:
Open Amity Console. Select Settings → Push Notifications & Upload this .p12 file to Amity Console.
This certificate can be used to receive push notification in your production build (Distributed through Appstore or Testflight). Currently we do not support receiving push notification in Debug build.
That’s it. Now the certificate is setup, Please follow the steps shown in Register & Unregister Push Notifications section to correctly send APNS token to receive push notification.
Please make sure you have Push Notification capabilities enabled in your Xcode Project.
FCM dependency:
Before you can start receiving push notifications, you need to obtain a FCM unique token string that identifies each FCM client app instance:
You can initialize the services with the obtained token. Please note that the FCM token can be changed through application life cycle. Please make sure that the FCM token supplied to the messaging SDK is up to date. To notify the messaging SDK of the latest token, the following line of code can be called whenever necessary:
To retrieve push notifications, use a service that extends FirebaseMessagingService
. Refer to Firebase's messages handling documentation for the detailed information.
Since Google play services are banned in China, The messaging SDK provides Baidu push services as a substitute for FCM. The messaging SDK requires an api key and a secret key from Baidu:
Baidu dependency:
Note: Baidu push services require number of additional permissions. You can find a list of permissions here.
Baidu API key is needed for Baidu push services initialization:
Note: The messaging SDK always consider FCM as a primary push provider and Baidu as a secondary push provider. If the messaging SDK detects Google play services on the device, Baidu push services won't be initialized.
The SDK offers push notification settings per user, allowing users to configure whether to enable or disable push notifications for specific feature modules. This configuration applies universally to every device logged in as the same user.
Configurable modules include CHAT
, SOCIAL
, and LIVE_STREAM.
The SDK provides "getSettings()
" function within User Notification to inspect the current settings of each feature module.
The functionality isn't currently supported by this SDK.
The SDK provides "enable()
" function where user can specify the settings of each module and "disableAll()
" function where user can choose to disable notifications on every module.
The functionality isn't currently supported by this SDK.
Registering your app for push notification will require a registered AmityClient
instance (necessary to know which user is associated with this device) and a push notification token.
Amity's Development Kit does not manage:
user-facing requests for push notifications and authorizations
the creation and refreshing of push notification tokens
It's up to your app to take those steps and pass the notification token to the SDK.
We recommend observing the completion block outcome to ensure a successful registration.
If the device was previously registered with this or another user, the previous registration is invalidated as soon as this new request is received, which means that the device will always receive notifications of up to one user.
Unlike the registration, unregistering for push does not require the AmityClient
instance to be associated with any user, therefore you can unregister the device from receiving push notifications as soon as the AmityClient
has been initialized with a valid API key.
The unregistration allows to pass an optional userId
:
if a valid userId
is passed, Amity's backend will stop sending push notifications to this device only if the currently active push notification associated with this device is also associated with that user. No action is taken otherwise.
if no userId
is passed, Amity's backend will stop sending push notifications to this device.
You can register and unregister as many times as you'd like, however please remember that we use the "Last write wins" strategy.
The SDK has three levels of notifications and in order for it to be sent, a notification has to pass throughout all three levels.
Network Level: (via Admin Panel) turning off notifications at this level effectively disable push notifications altogether for all of your customers.
User Level: (via client) A user can choose to enable/disable notifications per feature module. Please note that this setting is per user, not per device: regardless of which device sets this toggle, the new preference will take effect in all the devices where the user is logged in.
Channel or Community Level: (via client) A user can choose to enable/disable notifications per channel or community (where is member of). Again, this preference is per user, not per device.
In addition to push notifications, we also offer a Notification Tray that stores the notification history for each user.
Push notifications are small pop-up messages triggered by an application, even when the application is not open. Push notifications are an essential part of social features that a customer must provide to their end users.
Clients who want to have the push notifications delivered to their own servers first in order to customise before it reaches their users, can opt for this method.
In this solution, events are sent from Amity’s servers to the client’s servers via webhook. Clients can decide what to do with each events before it reaches the end user's device as notification. Clients have the ability to edit the notifications (i.e: translate the message), filter them (based on specific use case or user preferences), and perform analytics before sending them to the users. With this new feature, clients can also have notifications for web apps.
For more information, go to Webhook Events settings.
In this scenario, there's no SDK involvement needed. The whole notification process is managed on your end.
With this solution, the notifications will be triggered and delivered to your users directly by Amity's servers. There's nothing that the iOS client has to do in order to display the notification to your users. Amity's servers will prepare for you a notification that can be directly displayed to the user as and when it's received.
Click for more Network Level settings.
Click to learn on different SDK Settings.
Direct push notifications only support on iOS, Android, and Flutter SDKs.
As Amity's servers are responsible for choosing the content of the push notification, you can expect your users to receive the following notifications for different kinds of events:
Event: New channel has been created and the user has been added among other members. Push Notification Title: %s
(%s
= New Channel display name) Push Notification Body: You're now member of %s!
(%s
= New Channel display name)
Event: A new user has joined a channel. Push Notification Title: %s
(%s
= user display name) Push Notification Body: %1s has joined %2s
(%1s
= user display name, %2s
= channel display name)
Event: A new message has been received in a channel where the user is already a member. Push Notification Title: %1s (%2s)
(%1s
= user display name, %2s
= channel display name) Push Notification Body: %s
(%s
= message text body if text message, Image Message
if image message, Special message
otherwise)
A new push notification will be sent to a specific user when:
A new message is sent in a channel of the user who is already an existing member of it.
A new channel is created and the user is among the listed members of the channel on creation.
A new member joins a channel of the user who is already an existing member of it.
The SDK offers push notification settings per channel, allowing users to configure whether to enable or disable push notifications for specific channel. This configuration applies universally to every device logged in as the same user.
The SDK provides "getSettings()
" function within Channel Notification to check whether push notification is enabled on the channel.
The functionality isn't currently supported by this SDK.
The SDK provides "enable()
" and "disable()
" functions where user can choose whether to enable or disable push notifications coming from the channel.
The functionality isn't currently supported by this SDK.
The SDK offers push notification settings per community, allowing users to configure which notification events should be enabled on the community. This configuration applies universally to every device logged in as the same user.
Configurable events include POST_CREATED
, POST_REACTED
, COMMENT_CREATED
, COMMENT_REACTED
, COMMENT_REPLIED
, STORY_CREATED
, STORY_REACTED
, STORY_COMMENT_CREATED
The SDK provides "getSettings()
" function within Community Notification to inspect which notification events are enabled on the community.
The functionality isn't currently supported by this SDK.
The SDK provides "enable()
" function where user can choose which notification events to be enabled on the community and "disable()
" function to disable all notification events on the community.
The functionality isn't currently supported by this SDK.