How to enable push notifications in Xcode 12

Viewed 2874

I am trying to set push notifications for firebase phone authentication. but i could't find push notification here. What can i do?

3 Answers

In Signing & Capability -> Click on "+Capability" and type "Push" you will get Push Notification Option. Now long press on Push Notifications and Drop in your Signing & Capability Window.

enter image description here

The reason that the Push Notifications is not possible to enable is that you need to have a bundle identifier which has it enabled.

To create a new bundle identifier where push notifications are enabled do the following:

  1. Go to the following URL to create a new identifier: https://developer.apple.com/account/resources/identifiers/list
    • Click on new Identifier (plus symbol, as indicated in the image below)

enter image description here

  1. Select the App IDs alternative and press continue.

enter image description here

  1. Select App and click continue

enter image description here

  1. Choose a fitting name for your identifier (something like com.foo.bar)
    • Here it is required to choose the explicit alternative to be able to enable push notifications with your bundle identifier
    • Select the wanted capabilities and you're done with creating a new bundle identifier.

enter image description here

  1. Finally you need to add the new bundle identifier in the Xcode project like shown in the figure below.

enter image description here

Not all capabilities are available depending on if you are using a paid Developer Program account, or working with Xcode's free provisioning.

Pertaining to Capabilities/what you can or can't do based on account type - the link is: https://developer.apple.com/support/app-capabilities/

Related