You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/build_ios.md
+27-33Lines changed: 27 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,40 +1,34 @@
1
-
# iOS Setup: Push Notifications + Live Activities
1
+
# iOS Setup (React Native): Push Notifications + Live Activities
2
2
3
-
Configure the demo Flutter iOS project (`com.onesignal.example`) for OneSignal push notifications and live activities. All paths below are relative to the `ios/`directory.
3
+
Configure the React Native demo iOS project for OneSignal push notifications and live activities. All paths below are relative to `examples/demo/ios/`unless stated otherwise.
4
4
5
5
---
6
6
7
7
## 1. Podfile
8
8
9
-
Open `ios/Podfile` and make the following changes.
9
+
Open `Podfile` and keep the main React Native target (`target 'demo' do ... end`) as-is.
10
10
11
-
**Uncomment the platform line** (or add it if missing):
12
-
13
-
```ruby
14
-
platform :ios, '13.0'
15
-
```
16
-
17
-
**Add two new targets** after the `Runner` target block and before `post_install`:
11
+
Add two extension targets after the `demo` target block:
@@ -55,7 +49,7 @@ This enables push notifications (`aps-environment`) and an App Group shared with
55
49
56
50
### Info.plist
57
51
58
-
In `Runner/Info.plist`, add the `UIBackgroundModes` array inside the top-level `<dict>`:
52
+
In `demo/Info.plist`, add `UIBackgroundModes` inside the top-level `<dict>`:
59
53
60
54
```xml
61
55
<key>UIBackgroundModes</key>
@@ -68,7 +62,7 @@ In `Runner/Info.plist`, add the `UIBackgroundModes` array inside the top-level `
68
62
69
63
## 3. Notification Service Extension
70
64
71
-
Allows OneSignal to process notifications before display (rich media, badges, etc). Create the `OneSignalNotificationServiceExtension/` folder with three files.
65
+
Allows OneSignal to process notifications before display (rich media, badges, attachments). Create the `OneSignalNotificationServiceExtension/` folder with three files.
72
66
73
67
### NotificationService.swift
74
68
@@ -138,7 +132,7 @@ All standard `CFBundle*` keys are required for the simulator to install the exte
The `project.pbxproj` needs native target entries for both extensions. These are complex (UUIDs, build phases, configuration lists) and are best done by opening the `.xcodeproj` in Xcode. The key requirements:
265
+
The `project.pbxproj` needs native target entries for both extensions. These are UUID-heavy and easiest to configure in Xcode (`demo.xcodeproj`). Key requirements:
272
266
273
-
**Runner target changes:**
274
-
- Add `CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements` to all Runner build configurations (Debug/Release/Profile)
275
-
- Add an `Embed Foundation Extensions` copy-files phase (`dstSubfolderSpec = 13`) embedding both `.appex` products. This phase must appear **before** the `Thin Binary` script phase to avoid a build cycle.
276
-
- Add target dependencies from Runner to both extension targets
267
+
**`demo` target changes:**
268
+
- Add `CODE_SIGN_ENTITLEMENTS = demo/demo.entitlements` to all app build configurations
269
+
- Add an `Embed Foundation Extensions` copy-files phase (`dstSubfolderSpec = 13`) embedding both `.appex` products
270
+
- Add target dependencies from `demo` to both extension targets
0 commit comments