firebase asking for key id when activating for iOS app - ios

What does the key id mean? Please help me, I don't know what to enter in there.

If you want Push notification using FCM- Firebase Cloud messaging you need to provide either key or .p12 file. You can create in your developer account.Visit this link.
Also, its not compulsory if you are using firebase as a only database purpose. If you want push notification or cloud message then you need to provide this certificate or key things.
In your developer account you have to follow below steps
Step 1
Step 2
Step 3
Step 4

In your apple account go to Certificates, Identifiers & Profiles section.You can see Keys section in left side category.
Click Keys->All, Now you can see list of keys.
Click your key which you created for firebase APNS auth key.it will show prompt it shows Key ID:

You have selected "APNS Auth key" option while uploading .p12 file (Attached image (1) ).
To generate a "APNS Auth key", You should open developer.apple.com, and generate key from below attached image.
If you don't have "APNS Auth key", you should go with "APNs Certificate" option in firebase (Attached image (2). In that case, Firebase will not ask you for "key id".

Related

iOS AWS SNS Create platform application fail with error "There was an error reading the selected certificate."

After downloading my certificate from the apple developer portal, I successfully create a p12 file but whenever I try to create a platform application on aws, enter the certificate password, I just keep getting the error below.
There was an error reading the selected certificate. Verify the
password and try again.
I have tried with short and no passwords but nothing seems to accept the password.
Any ideas?
I was able to make this work, by doing the following:
Delete all old keys related to previous attempts in your Keychain > login (macos)
Request a new certificate from Request Certificate from Authority. Make sure no keys are selected when you execute this function.
I chose a single word in lowercase for Common name.
Add certificate to Apple Developer Portal
Download the CSR
Double click on the CSR to import the keys into your Keychain.
Your private key should have a dropdown with the certificate listed. My previous attempts did not have this. Export the p12.
The p12 worked in AWS SNS when entering the password, the public and private keys were extracted from the p12.

Upload APNs to Firebase console fails - "There is no Team ID stored for this app"

Trying to upload APNs file to firebase console.
Inserted Team ID and Key ID - Got "There is no Team ID stored for this app" (Although inserted):
Please advise
It's simply a bug in Firebase Console.
Just refresh and you'll get the following:
Steps:
Go to Firebase Project Settings
Select the "General" tab
Select your iOS app and Enter Team ID. Refer to the image below.
After this step Team ID will automatically come while you upload APNs Auth Key.

How to configure Azure Notification Hub with APNS token for push notifications

I had a lot of trouble getting through this because much of the information out there was out of date. I figured I'd post my own Q and A.
1) Login to developer.apple.com with your membership ID and go to Certificates, Identifiers and Profiles
2) Go to the keys section
3) Click add, give the key a memorable name and enable APNs
4) Pay attention to the Key ID (note it)
5) Download the .p8 file that gets created, open it in textedit (or some editor) and copy the key that's inside. Mine had -----BeginRequest ----EndRequest... I just ignored that and copied the key itself
6) You will also need your app id. Usually goes com.company.ProductName
7) You will also need your team id. You can get this from your Membership Details Page (go back to main account page and choose Membership, then look for TeamID)
8) Finally, go to Azure Notification Hubs and configure APNs.
9) Enter the key id that you noted from the key you generated
10) Enter the app id in App Name field (I know this seems weird but trust me). Example com.Company.Product
11) Enter the team id in the App Id field. (Yes, this is a little strange)
12) Finally take the token you copied from the contents of .p8 file and paste that in token field.
13) Select whether its a Sandbox (debug) or Production and you are all set.
If it works without error you are ready to go. If you get an error you probably didn't enter the information correctly for one of the steps. Pay close attention to App Name and App Id because they are misleading. Follow the above instructions closely.
The OP has already figured it out, but in case someone's wondering in the future, there's an official blog post about it: Token-based (HTTP/2) Authentication for APNS with screenshots and property name mapping.

CSR algorithm/size is incorrect.Expected RSA 2048

I am trying to integrate apple pay with braintree. I have followed up the following instructions to enable apple pay in the brain tree. In the first step, if you click on certificate signing request, it downloads a braintree_app_pay.certSigningRequest file which is used in the apple membership.
When I choose to create payment process certificate, I am getting the following error.
complimenting what #zepp said, you need to specify when creating CRS, and you can that by following the process below
Go to Keychain Access
Click on Certificate Assistance
Click on Request Certificate from Certificate Authority (click for image)
Enter all information and click on "Let me specify key pair Information"checkbox, then click on Continue
Select KeySize to be 256 and Algorithm to be ECC (click for image)
Then click on continue.
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact our Support team.
Make sure you're selecting the Apple Pay Certificate option under Production (even if this is for a Sandbox; see the Braintree Apple Pay configuration docs for details) when choosing the type of certificate to add in the Apple Developer portal. Apple Pay CSRs should be generated with ECC, not RSA.
Here's what the CSR prompt screen should look like. Although you'll be uploading the CSR obtained from Braintree instead of generating one, note Apple's specifications for the key:
Please follow below steps[If use Apple Pay with stripe or any other payment gateway]:
Double click on CSR (Downloaded from Stripe), [It will open Certificate Assistant]
Click on Continue
Select 'Request a certificate from an existing CA', and Continue
In Certificate Information screen, Enter User Email Address, Common Name, Leave CA Email Address empty, Select 'Saved to disk & checked Let me specify key pair information' [Select your specific location and save]
In Key Pair Information screen, select 'ECC' algorithm & select Key size : 256 bits and continue.
Now use this CSR in your payment processing certificate.
This issue is not specific to Apple Pay or Braintree - I ran into the same issue when trying to create a CSR for getting a Safari certificate from Apple.
What's important to know is that you need to select the iCloud keychain before using the Request Certificate from Certificate Authority command. If you don't, another keychain may be active, causing wrong keys to be used.
From Apple Developer Forum
Within the Keychain Access drop down menu, select Keychain Access >
Certificate Assistant > Request a Certificate from a Certificate
Authority.
In the Certificate Information window, enter the following information:
In the User Email Address field, enter your email address.
In the Common Name field, create a name for your private key (e.g., John Doe Dev Key).
The CA Email Address field should be left empty.
In the "Request is" group, select the "Saved to disk" option.
Select "Let me specify key pair information".
Click Continue within Keychain Access and select the file location.
Set the Key Pair Information to the following:
Algorithm: ECC
Key Size: 256 bits Click
Continue within Keychain Access to complete the CSR generating process.
I don't get it, because it's said You must use the CSR we provide. Do not create a CSR file yourself on braintree website.
And with this CSR file, it's always failed on apple's upload page.
Edit:
I finally upload success with follow steps of #anjali-jariwala 's answer.
Just in last step, I choose RSA & 2048 as alert requirement.
For me I accidentally chose Yes when asked Will payments associated with this Merchant ID be processed exclusively in China?
Choosing No solved the issue for me
I had the same error. The mistake on my part was choosing the wrong type of certificate while creating it in the Apple developer portal. I used 'Apple Pay Merchant Identity Certificate', but I needed to use 'Apple Pay Payment Processing Certificate', which solved the issue.

Amazon sns (push notification) does not send to IOS application

Recently the app can not receive notification, the android side works fine but the ios one has fail
so here is what I have attempt:
1) generate token from apple apn service
2) create the endpoint at amazon backend
3) publish the message at amazon backend
4) it does not receive message and the endpoint will go to disabled after a while.
And I have checked the following:
1) try serveal ios device , including iphone/ ipad/ipod touch also the same result
2) checked the secret key/ platform arn it is matched
3) created another platform ARN but still the same.
So , what direction should I continue to debug , e.g. is the push notification cert ? which part of coding should I check, as it works before but only fail recently.
Thanks a lot.
Create your APNs sandbox(development) certificate(make sure you are selecting bundle identifier of your development certificate)
Once you create sandbox certificate, verify push notification service is enabled for your provisioning profile(you can not create provisioning profile with your APNS certificate, you have to use your provisioning profile created with development certificate)
If you have already installed development provisioning profile then delete is from following path "xcode-prefrences-select apple developer account - view details - provisiong profile"
Download development provisioning profile from member center and install it. Select newly installed profile and certificate
Login to Amazon SNS and select nearest location(at top right corner) as shown in below image with red oval.
Change Location place
Under "Mobile Services" section select SNS (Push Notification Service )
Now you will be at SNS Home Screen, now select Application from side Menu
Click on "Create Platform Application". Enter application name then select Push Notification Platform as "Apple Development" and Push Certificate type as "iOS Push Certificate"
Now you have to upload privateKey.p12
Process to get privateKey.p12
To get privateKey.p12, download APNs(sandbox) certificate and install it in krychain. then open keychain Access and expand certificate then select name of developer account holder(it will have icon of key and Kind as "private key")
Now right click on account holder name and click on export(enter password to file if you want or else leave it blank) then name is as privatekey.p12 and store it on desktop
Choose privateKey.p12 from desktop then enter password if you have set then click on "Load Certificate from File" then certificate and private key fields will be populated with values exported from privateKey.p12.
Click on "Create Application Platform", your new ios Application is created.
Click on ARN, it will go inside your app. now click on "Create Platform Endpoint"
Run your mobile app and get deviceToken
Enter device token in "Device token" field and give device name in user data. Now click on "Add Endpoint"
Select added endpoint and click on "Publish to Endpoint"
Select message format as per your need then enter your message then click on "Publish Message".
If the SNS endpoint is disabled after a while, that means your APNS certificate has some issue. Do you mistakenly use a sandbox certificate for prod, or visa versa? Do you have the right certificate and private key combo? See http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html for more information.
Make your Response as follow :
if you're consuming from android use GCM or for ios use APNS_SANDBOX
$sns = AWS::createClient('sns');
$message = json_encode(['default' => '', 'APNS_SANDBOX' => json_encode($data), 'GCM' => json_encode(['data' => $data])]);
$sns->publish([
'TargetArn' => $arn,
'Message' => $message,
'MessageStructure' => 'json'
]);

Resources