Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/_partials/_silentNotification_Code.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Admonition, TabItem, Tabs } from "@site/src/components/forDocs";

3. Implement background handler in `AppDelegate`.

<Tabs groupId="ios-languages">
<TabItem value="Objective-C" label="Objective-C">
```objc
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

NSString *origin = userInfo[@"origin"];

if ([origin isKindOfClass:[NSString class]] && [origin isEqualToString:@"helpshift"]) {
// Call the Helpshift background handler and pass the completion block
[Helpshift handleSilentBackgroundNotification:userInfo withCompletionHandler:completionHandler];
}
}

````
</TabItem>
<TabItem value="Swift" label="Swift">
```swift
func application(
_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable : Any]
) async -> UIBackgroundFetchResult {
let origin = userInfo["origin"] as? String
if origin == "helpshift" {
return await Helpshift.handleSilentBackgroundNotification(userInfo)
}
return .noData
}
````

</TabItem>
</Tabs>
19 changes: 19 additions & 0 deletions docs/_partials/_silentNotification_iOS.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Image } from "@site/src/components/forDocs";
import AndroidInAppSample from "@site/docs/_partials/_proactiveAnd_inappSamples.mdx";

## Handling Silent notification for in-app

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title could be: "Handling Silent Notification for In-App Proactive Engagement Notifications"


By default, in-app notifications are sent directly to the device's notification tray as fallback push notifications.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In-App instead of "in-app"

@sumeet-helpshift sumeet-helpshift Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, In-App notifications are sent directly to the device's notification tray, as fallback push notifications, if your application is in background/killed state.

However, you can configure the SDK to display notification exclusively as in-app notification while the user is actively using the app.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, you can configure the SDK to display notification exclusively as In-App notification and show up only when the user is actively using the app.


- If the app is terminated by the system, silent pushes may not wake it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 points were supposed to be in a note i assume. Did you change it?

- Background delivery is not guaranteed: silent notifications are best-effort and may be delayed or dropped when the system is low on resources or the app has been force-quit.
- When silent notifications are enabled and fallback push is disabled, you can't use this feature to reach or re-engage inactive users. Because in-app notifications only appear when the app is in the foreground.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When silent notifications are enabled/handled in your app but fallback push is disabled, you can't use this feature to reach or re-engage inactive users. In-App notifications are displayed only when the app is in the foreground.

Please check if the re-wording is correct.


#### Implementation Steps

1. Enable background remote notifications in Xcode:

> **_Xcode → Capabilities → Background Modes → Remote Notifications_**

<Image width="full !p-0" src="/static/books/sdkx_ios/background-modes.png" />
5 changes: 5 additions & 0 deletions docs/sdkx-cocos2dx/proactive-engagement.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {

import AndroidiOSProactiveNotifBehaviourTable from "@site/docs/_partials/_androidAndiOSProactiveNotifBehaviourTable.mdx";
import AndroidInAppSample from "@site/docs/_partials/_proactiveAnd_inappSamples.mdx";
import SilentNotifications from "@site/docs/_partials/_silentNotification_iOS.mdx";
import SilentNotificationCode from "@site/docs/_partials/_silentNotification_Code.mdx";

<Intro>

Expand Down Expand Up @@ -330,3 +332,6 @@ bool HelloWorld::init()
HelpshiftCocos2dx::setHelpshiftProactiveConfigCollector(getAPIConfig);
}
```

<SilentNotifications />
<SilentNotificationCode />
46 changes: 45 additions & 1 deletion docs/sdkx-react-native/proactive-engagement.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {

import AndroidiOSProactiveNotifBehaviourTable from "@site/docs/_partials/_androidAndiOSProactiveNotifBehaviourTable.mdx";
import AndroidInAppSample from "@site/docs/_partials/_proactiveAnd_inappSamples.mdx";
import SilentNotifications from "@site/docs/_partials/_silentNotification_iOS.mdx";
import SilentNotificationCode from "@site/docs/_partials/_silentNotification_Code.mdx";

<Intro>

Expand Down Expand Up @@ -278,4 +280,46 @@ const proactiveConfig = {
};

setProactiveConfig(proactiveConfig);
```
```

<SilentNotifications />

3. Implement background handler in `AppDelegate`.

<Tabs groupId="ios-languages">
<TabItem value="Objective-C" label="Objective-C">
```objc
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
[RNNotifications didReceiveBackgroundNotification:userInfo withCompletionHandler:completionHandler];
}

````
</TabItem>
<TabItem value="Swift" label="Swift">
```swift
override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
RNNotifications.didReceiveBackgroundNotification(userInfo, withCompletionHandler: completionHandler)
}
````

</TabItem>
</Tabs>

4. Add RN Notification listener for background notifications.

```javascript
Notifications.events().registerNotificationReceivedBackground(
async (notification, completion) => {
const notificationData = notification.payload;
const doesNotificationDataHaveOrigin =
notificationData?.origin === "helpshift";
if (doesNotificationDataHaveOrigin) {
const value = await handleIOSSilentNotification(notificationData);
completion(NotificationBackgroundFetchValue[value]);
} else {
completion(NotificationBackgroundFetchResult.NEW_DATA);
}
},
);
```
5 changes: 5 additions & 0 deletions docs/sdkx-unity/proactive-engagement-ios.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
Tabs,
Image
} from "@site/src/components/forDocs";
import SilentNotifications from "@site/docs/_partials/_silentNotification_iOS.mdx";
import SilentNotificationCode from "@site/docs/_partials/_silentNotification_Code.mdx";

import ProactiveNotifBehaviourTable from "@site/docs/_partials/_iOSProactiveNotifBehaviourTable.mdx";

Expand Down Expand Up @@ -177,6 +179,9 @@ For example, following code shows how to implement `HelpshiftProactiveAPIConfigC
}
```

<SilentNotifications />
<SilentNotificationCode />

<Admonition type="caution" title="Note">

- You need to call this API after `Install` API and before `handleBackgroundNotificationClick:withCompletionHandler:`
Expand Down
7 changes: 6 additions & 1 deletion docs/sdkx_ios/proactive-engagement.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
} from "@site/src/components/forDocs";

import ProactiveNotifBehaviourTable from "@site/docs/_partials/_iOSProactiveNotifBehaviourTable.mdx";
import SilentNotifications from "@site/docs/_partials/_silentNotification_iOS.mdx";
import SilentNotificationCode from "@site/docs/_partials/_silentNotification_Code.mdx";

<Intro>

Expand Down Expand Up @@ -183,4 +185,7 @@ func getAPIConfig() -> Dictionary<String, Any> {
- You need to call this API after `install` API and before `handleBackgroundNotificationClick:withCompletionHandler:`
- The <b>"customIssueFields"</b> key has been deprecated. We strongly recommend transitioning to using the <b>"cifs"</b> key as the preferred method for passing custom issue fields.

</Admonition>
</Admonition>

<SilentNotifications />
<SilentNotificationCode />
Binary file added static/static/books/sdkx_ios/background-modes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.