[FTF-283] Add getting started guide for APNs for swift.#3147
[FTF-283] Add getting started guide for APNs for swift.#3147
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7c4bab8 to
9f94a7f
Compare
9f94a7f to
3feba8d
Compare
3feba8d to
b482d42
Compare
b482d42 to
898bda5
Compare
898bda5 to
dcd68ab
Compare
|
|
||
| ### Create a Swift project with Xcode <a id="prerequisites-create-project"/> | ||
|
|
||
| Create a new iOS project with SwiftUI. For detailed instructions, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/swiftui). |
There was a problem hiding this comment.
How much detail do we want here? I think we should probably assume that someone knows how to setup a Swift project, so we perhaps cut this down to just making sure you've got ably-cocoa installed? cc @m-hulbert
| ```swift | ||
| // MARK: - UNUserNotificationCenterDelegate Methods | ||
|
|
||
| /// Handle notification when app is in foreground |
There was a problem hiding this comment.
Should we be elaborating on handling background notifications?
| ``` | ||
| </Code> | ||
|
|
||
| To receive messages on the channel as push notifications, you need to subscribe to the push notifications |
There was a problem hiding this comment.
I think it would be good to discuss explicitly here that there are two ways of doing push notifications - direct and channel-based. Perhaps covering (very briefly) when you'd use each, and highlighting that for direct you don't need explicit subscriptions?
| ``` | ||
| </Code> | ||
|
|
||
| To test this code, you can send push notifications from the Ably dashboard or using the API (see the next step). |
There was a problem hiding this comment.
All of our other guides lean into the CLI here, so I think we put that first. Lets add CLI installation to the prerequisite of the guide?
| ``` | ||
| </Code> | ||
|
|
||
| You can also send push notifications by publishing a message with a `push` message's `extras` field to a specific channel: |
There was a problem hiding this comment.
I think we perhaps need a specific call out in the guide about there being two ways to do push (see above comment)
| `LocationPushService.swift` file in your extension target. | ||
| Use `locationManager(_:didUpdateLocations)` delegate method to handle location updates as needed. | ||
|
|
||
| ## Step 6: Displaying the results <a id="step-6"/> |
There was a problem hiding this comment.
Should displaying it come earlier in the guide, so that people can see results as they go?
|
|
||
| Continue to explore the documentation with Swift as the selected language: | ||
|
|
||
| * Check our push example: [AblyPushExample](https://github.com/ably/ably-cocoa/tree/main/Examples/AblyPush) |
There was a problem hiding this comment.
| * Check our push example: [AblyPushExample](https://github.com/ably/ably-cocoa/tree/main/Examples/AblyPush) | |
| * Check our [push example](https://github.com/ably/ably-cocoa/tree/main/Examples/AblyPush) |
GregHolmes
left a comment
There was a problem hiding this comment.
Other than Andy's comments, and my 1 below. I've also got this recommendation, that we update the Step headings to be inline with the other guides:
Step 1: Set up Ably
Step 2: Set up push notifications
Step 3: Receive push notifications
Step 4: Send push notifications
Step 5: Enable location pushes
Step 6: Display the results
|
|
||
| ## Step 6: Displaying the results <a id="step-6"/> | ||
|
|
||
| Now, lets complete our `ContentView` to display all the results of everything we added above. |
There was a problem hiding this comment.
| Now, lets complete our `ContentView` to display all the results of everything we added above. | |
| Now, let's complete our `ContentView` to display all the results of everything we added above. |
|
@AndyTWF @GregHolmes I've addressed your comments and added more info, please read commit messages for details. I guess Ably dashboard and CLI don't yet support location pushes, is it something manageable rather soon? Otherwise I need to remove the line saying that "Use Ably dashboard, Apple dashboard, or Ably CLI to send location push notifications to your device" (Apple dashboard supports location pushes). |
87cc344 to
224ebd8
Compare
224ebd8 to
1037cdb
Compare
Description
Checklist