0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Memo: Test push notification on iOS simulator

Last updated at Posted at 2023-05-14

Step 1: Enable push notificaiton on certificate on Apple developer portal

Step 2: Request Push notification in iOS app

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in
        if let error {
            print("Notification access not granted.", error.localizedDescription)
        }
    }

Step 3: Save this test.apns

{
    "Simulator Target Bundle": "<bundle_id>",
    "aps":{
        "alert":"Test",
        "sound":"default",
        "badge":1
    }
}

Step 4: drag test.apns to iOS simulator

Screenshot 2023-05-14 at 11.04.16.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?