Skip to content
Merged
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
6 changes: 3 additions & 3 deletions content/in-app-ui/android/sdk/push-notifications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Documentation to help you get started with the Push Notifications
section: SDKs
---

**Note:** We Recommend taking advantage of our [KnockMessagingService & KnockActivity](/in-app-ui/android/sdk/reference#knockmessagingservice--knockactivity) to make managing your Push Notifications simpler.
**Note:** We recommend taking advantage of our [KnockMessagingService & KnockActivity](/in-app-ui/android/sdk/reference#knockmessagingservice--knockactivity) to make managing your push notifications simpler.

## Prerequisites

Expand Down Expand Up @@ -64,7 +64,7 @@ section: SDKs
</service>
```

## 5: Requesting user permission for push notifications
## 5. Requesting user permission for push notifications

- To prompt the user to approve or deny push notification permissions call the `Knock.shared.requestNotificationPermission()` method.

Expand Down Expand Up @@ -96,7 +96,7 @@ section: SDKs
}
```

## 5. Receive push notifications
## 7. Receive push notifications

To detect when a push notification is received in the foreground:

Expand Down
24 changes: 12 additions & 12 deletions content/in-app-ui/ios/sdk/push-notifications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ description: "Usage guides to help you get started with the Push Notifications i
section: SDKs
---

**Note:** We Recommend taking advantage of our [KnockAppDelegate](/in-app-ui/ios/sdk/reference#knockappdelegate) to make managing your Push Notifications simpler.
**Note:** We recommend taking advantage of our [KnockAppDelegate](/in-app-ui/ios/sdk/reference#knockappdelegate) to make managing your push notifications simpler.

## Prerequisites

Before proceeding, ensure you've configured push notifications within your Knock account. For guidance on this initial setup, refer to our [Push Notification Configuration Guide](/integrations/push/overview).

## Step 1: Enabling Push Notifications in Your App
## Step 1: Enabling push notifications in your app

1. **Configure APNs in Your App:**
1. **Configure APNs in your app.**
- Open your project in Xcode.
- Navigate to your app target's **Signing & Capabilities** tab.
- Click the "+" capability button and add **Push Notifications** to enable Apple Push Notification service (APNs).
2. **Enable Background Modes:**
2. **Enable background modes.**
- Still in the **Signing & Capabilities** tab, add the **Background Modes** capability.
- Check **Remote notifications** to allow your app to receive silent push notifications.
- Check **Remote notifications** to enable your app to receive silent push notifications.

## Step 2: Registering for Push Notifications
## Step 2: Registering for push notifications

Implement the following in your AppDelegate or SceneDelegate to register for push notifications:

Expand Down Expand Up @@ -62,7 +62,7 @@ class MyAppDelegate: UIResponder, UIApplicationDelegate {
}
```

## Step 3: Updating the Message Status of a Push Notification.
## Step 3: Updating the message status of a push notification

If a push notification is sent via Knock, it will contain a `knock_message_id` property that includes the corresponding message Id. This can then be used to update the message status.

Expand All @@ -83,13 +83,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
```

## Step 4: Configuring Silent Push Notifications
## Step 4: Configuring silent push notifications

Silent push notifications allow your app to update content in the background without alerting the user. Ensure that your Knock APNs message template has silent notifications enabled.

<Image
src="/images/message-template-settings.png"
alt="Message Template Settings"
alt="Message template settings"
className="rounded-md mx-auto border border-gray-200"
width={1470}
height={1200}
Expand Down Expand Up @@ -117,7 +117,7 @@ class MyAppDelegate: UIResponder, UIApplicationDelegate {
}
```

## Full Example
## Full example

Here's the complete `AppDelegate` implementation:

Expand Down Expand Up @@ -182,7 +182,7 @@ In your `application(_:didFinishLaunchingWithOptions:)` method, add the followin
}
```

### Step 2: Override Push Notification Registration Methods
### Step 2: Override push notification registration methods

Override the `application(_:didRegisterForRemoteNotificationsWithDeviceToken:)` method to prevent the `KnockAppDelegate` from handling this automatically:

Expand All @@ -206,7 +206,7 @@ extension AppDelegate: MessagingDelegate {
}
```

### Full Example
### Full example

Here's the complete `AppDelegate` implementation with FCM support:

Expand Down
Loading