-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add a possibility to simulate push notifications via simctl #1286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow,
This is really great and thanks for doing it so quickly!
🚀
*/ | ||
extensions.mobilePushNotification = async function mobilePushNotification (opts = {}) { | ||
if (!this.isSimulator()) { | ||
throw new Error('This extension only works on Simulator'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Name | Type | Required | Description | Example | ||
--- | --- | --- | --- | --- | ||
bundleId | string | yes | The bundle identifier of the target application | com.apple.Preferences | ||
payload | map | yes | Valid Apple Push Notification values. Read the `Create the JSON Payload` topic of the [official Apple documentation](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification?language=objc) for more details on the payload creation. | `{"aps": {"alert": "This is a simulated notification!", "badge": 3, "sound": "default"} }` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I could made a comment, I have already try to use {"aps": {"alert": "This is a simulated notification!", "badge": 3, "sound": "default"} }
and i got an error about Simulator Target Bundle
using Xcode 12.4. I have change it to {"Simulator Target Bundle": "your.apps.bundleId", "aps": {"alert": { "title": "This is a simulated notification!"}, "badge": 3, "sound": "default"} }
and it worked.
# [3.39.0](v3.38.0...v3.39.0) (2021-03-16) ### Features * Add a possibility to simulate push notifications via simctl ([#1286](#1286)) ([d8f320f](d8f320f))
🎉 This PR is included in version 3.39.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
# [3.39.0](appium/appium-xcuitest-driver@v3.38.0...v3.39.0) (2021-03-16) ### Features * Add a possibility to simulate push notifications via simctl ([appium#1286](appium#1286)) ([d8f320f](appium@d8f320f))
https://betterprogramming.pub/how-to-send-push-notifications-to-the-ios-simulator-2988092ba931