Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
fix: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed Feb 11, 2024
1 parent cddc736 commit 1356389
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ Andriod support is coming soon. Checkout [#1](https://github.com/candlefinance/p

## Usage

This only works for iOS. For Android, check out the issue [#1](https://github.com/candlefinance/push/issues/1).

### iOS

- [x] Request permissions
Expand All @@ -47,7 +45,7 @@ This only works for iOS. For Android, check out the issue [#1](https://github.co
#### Setup

1. You'll need to update your `AppDelegate.swift` to handle push check the example app [here](./example/ios/AppDelegate.swift) for an example.
2. If your AppDelegate is in Objective-C (`.mm|.m|.h`), create a new `AppDelegate.swift` file and bridging header then delete the Objective-C AppDelegate and main.m file. Finally copy the contents of the example app's `AppDelegate.swift` and bridge header to your project.
2. If your AppDelegate is in Objective-C (`.mm|.m|.h`), create a new `AppDelegate.swift` file and bridging header then delete the Objective-C AppDelegate and main.m file. Finally copy the contents of the example app's [AppDelegate.swift](./example/ios/AppDelegate.swift) and [bridge header](./example/ios/PushExample-Bridging-Header.h) to your project.
3. Make sure you're on `iOS 15` or later.

<br>
Expand Down
1 change: 1 addition & 0 deletions example/ios/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AppDelegate: RCTAppDelegate {

}

// 4
extension AppDelegate: UNUserNotificationCenterDelegate {

override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type AuthorizationStatus =
| 'notDetermined'
| 'provisional';

export interface NotificationReceivedData {
export type NotificationReceivedData = {
kind: 'foreground' | 'background' | 'opened';
payload: {
aps: {
Expand All @@ -29,7 +29,7 @@ export interface NotificationReceivedData {
custom?: any;
};
uuid?: string;
}
};

type DeviceTokenReceivedData = string;
type ErrorReceivedData = string;
Expand Down

0 comments on commit 1356389

Please sign in to comment.