简体   繁体   中英

How to enable push notifications in Xcode 12

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

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.

在此处输入图像描述

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)

在此处输入图像描述

  1. Select the App IDs alternative and press continue.

在此处输入图像描述

  1. Select App and click continue

在此处输入图像描述

  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.

在此处输入图像描述

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

在此处输入图像描述

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM