How to enable phone auth firebase, flutter, xcode - xcode

I have Flutter Firebase auth configured and it is working perfectly with Android. But with ios, I cannot seem to get it to work.
Am using Xcode and Flutter on MacOS deploying to a physical iphone()14.4) and I have followed the instructions:
Added googleservice-info.plist into project via Xcode.
Under Signing and capabilities in Xcode, Provisioning profile, Team , Bundle identifier, Signing certificate(Apple Development certificate) configured with no errors. Push Notifications(Release) also enabled.
In developer.apple.com, under Identities->myapp, I have enabled Push Notifications. I have also created development and production SSL certs inside Push Notifications. Also created key for Apple Push Notifications service (APNs).
In my Firebase project, I have added iOS apps and all the fields are populated. Under Cloud Messaging, in iOS apps, I have uploaded the APN key and both development and Production certs I got from Apple Developer.
I run 'flutter run --release' (I am using a physical iphone(14.4)) because debug mode is not allowed on 14.4. App installs successfully. I am able to navigate pages and even register email/pw with Firebase. But when I do a Firebase phone auth (verifyPhoneNumber), I keep getting an error as indicated by a snackbar error I coded in. Problem is that I cannot get the specific error from the logs since I have deployed using release and flutter logs remain blank.
I don't know what else to do. Please help.

Figured it out. Problem was with URL Types under Info of target Runner. Had to add URL Scheme. For those who has this problem, refer to the below.
https://firebase.google.com/docs/auth/ios/phone-auth
iOS uses captcha with Firebase.

Related

How to upload to Apple's My Apps from a Xamarin project

I specifically need help getting the app build into my apps. I am so new to the MAC ecosystem. I need to get my app build from my windows 10 box (parallels) running VS2017/Xamarin Forms project uploaded to My Apps. What i have found is helpful if you are using xcode on the mac.
I have read tons of pages and help files and with all of that what I have includes:
created an app in VS2017/Xamarin that runs happily on the emulator from the MAC (MacBook Pro)
purchased the app dev subcription from apple
created a Production certificate (I don't need this yet but I was in there so...)
created a Development certificate
created a key pair from the Dev cert (that show up in the keychain)
created an App Group
created my app's placeholder under My Apps on App Store Connect
added my iPhone to devices via connecting to the Mac getting the UDID from iTunes
created a development provisioning profile for my iPhone (Not sure how this helps my testflight plight)
Assumptions
You must submit for review the same way for both TestFlight and Prod release to the actual store.
You don't need to open the app in xcode outside Xamarin
There is a tool or concept I am missing out on.
For development outside of Xcode, you will want to use Apple's Application Loader App to upload your app to App Store Connect.
As I said in comment to Matt below his correct answer to my actual question above, I needed to get the project right to get to that point.
Here are the more intimate details for the lurkers. I hope this helps some of you.
I was getting, or trying, to get all of this in place manually instead of letting VS do it's work getting this stuff together while I got to coding. FastLane FTW
Open the account management window, go to Tools > Options > Xamarin > Apple Accounts
Add your AppleID
Click on your appleID
Click the add button
Select your id in the lower text area
then add your distro cert. As is proper you deploy to TestFlight as a prod release.
Then get over to to your iOS project properties:
Make sure that your project is outputting an IPA. (Not Beer ;) )
These are my settings that worked. There could be other configurations that work as well.
I never get the automatic provisioning to work. And while this bundle signing settings look like it will not work, it does. I have received my apple approval for beta and users are in testflight.
Also, make sure you update the version of the app in the plist for subsequent releases. This change is not carried through from the AssemblyInfo.cs as one might expect. viola.
If you see this during debug make sure your debug version has Developer (Automatic) set for your debug settings.
FWIW - My VS2017:
While this does not perfectly match the info # https://learn.microsoft.com/en-us/xamarin/cross-platform/macios/apple-account-management?tabs=windows it worked for me. That page was key to the solution and deserves citing. Your mileage may vary.
If I missed something please reach out and I will update this.

How to list provisioning profiles and installed iOS signing identities?

Environment:
Visual Studio 2015 on PC
Visual Studio (Xamarin) on Mac
iPad is connected to Mac
My setup used to work fine. From PC, I would be able to debug iOS apps running on the iPad.
Yesterday, I updated the Mac OS as well as my iPad iOS. I may have updated a few other things too. However, now I am running into problems deploying Xamarin iOS apps on the iPad.
I can create an iOS app in xcode and deploy it successfully. However, when I try to build my Xamarin app, I get the error "No installed profiles match the installed iOS signing identities."
There are a few posts on the forum that talk about a similar problem. I have gone through all these posts. I have also downloaded (once again) my iOS certificate from Apple developer portal and added it to my keychain store.
I still don't understand why I get the error. Would appreciate if someone can tell me how I can get the list of installed iOS signing identities and compare them against the list of provisioning profiles.
Also, when I look at my plist.info file, I see that, for key CfBundleIdentifier, the value is replace_bundle_id. I am wondering how I can tie this bundle id back to my provisioning profile. On Apple's portal, I see a bunch of provisioning profiles (I am part of an enterprise team). There is no field called bundle-id on these profiles. All each of them have is an app-id. Where do I related the bundle-id to the provisioning profile? Regards.
Provisioning profiles are all inside the directory: /Users/m.piccotti/Library/MobileDevice/Provisioning Profiles
Usually when I have these kind of problems and no time to understand what's wrong, I simply delete everything inside that directory and I download again all the profiles from Xcode. Naturally you can try this only if you are sure that you'll be able again to download all the provisioning profiles you need.
Or it could be that you have to set the right provisioning profile for the project:
This info is saved into iOS.csproj, the element CodesignProvision.
When you go to Apple Developer portal and check App IDs, you see the Name and ID of your app. The ID is your bundle ID. That you need to enter in your plist.
Based on that Xamarin will find your profiles.
Here is what I did to make it work. This is based on the feedback I received from the other two replies.
From the Apple developer portal, I looked at the ID of my app. This was in the form com.mycompany.myproduct. In my Xamarin iOS app's plist.info, the id was replace_bundle_id. I changed it to match the one from the portal.
Next, I cleaned the "Provisioning Profiles" directory on Mac and used xcode to create a test project and change the bundle id (from project options) to match the one on the portal. xcode automatically created a new profile.
This made the whole thing work. Now I am able to deploy and debug from my PC to iPad via Mac.
Our project was generated by Xamarin wizard a long time ago and used to work just fine until recently. I still do not know why replace_bundle_id worked in the past and stopped working all of a sudden. The only change I had made was that I upgraded the OSes on the Mac as well as my iPad.

My exported .ipa file of push notification app didn't send notification on device when installing via iTunes instead of Xcode build [Development]

I used OneSignal for push notification service.
(Development) I set Provision Profile of push notification service for my app
When I run from Xcode,everything works fine on every device.
But,when I create archive(.ipa) with Debug Scheme and install via iTunes,the device seem to connect to OneSignal Push Notification service.But,can't receive notification from our backend service that was connected to OneSignal.
So,I think there is a problem with APNS
Any help with that?Did I do something wrong.
If there was,please guide me?how to test push notification of iOS Development profile with archive (.ipa)?
The reason why notification didn't come in when I install with my custom .ipa that was create by Xcode archive manager was,it did set default provision profile generated by Xcode for testing on Devices which wasn't include for APNS.
So,in order to make it work when testing development APNS using .ipa files installation via iTunes instead of Xcode build,you need to use your custom provision profile that was created by yours for testing APNS for iOS Development(Not Distribution APNS).
1.Go to Product>Scheme>Edit Scheme and set the Archive Tab to Debug
2.Then connect to your device and tap Product>Archive
3.Then your Xcode will create Archive for your file that you can upload or export as .ipa.Do like these picture
Choose
Then it will ask you which provision profile that you gonna use,choose like me at below if u set custom provision profile at your build setting
Then export as .ipa for all compatible devices.And then you can receive notifications like you run from Xcode by installing that .ipa via iTunes
Happy Testing!!!
As you have able to recieve the push notification on every device when you run from the Xcode so it did not problem in APNS or Provision Profile. I thought it might be a problem at OneSignal service.
For checking the push notication please look into the Mac application which created by noodlewerk.
Please download and open it. After that It will ask for provide the .p12 file(which you will get from the keychain) and device token. After that click on the "Push" button which will send you the sample push notification message on respective device.
Hope it will help you.

APNS Invalid token error using Parse

I have an iOS app in Xcode 7 that used Push Notifications via Parse in development mode. I had to format my Mac’s hard drive and reinstall El Capitan and Xcode. Running my same old code, all my push notifications now get a “APNS Invalid token” error. I’m assuming the error is due to changes on my Mac.
I have revoked and replaced my APN certificate at the Apple Member Center, downloaded the new certificate, put in it my keychain, exported it to a p12, deleted my old certificate at Parse and installed the new p12 file. I also edited and renewed my Provisioning Profile at Apple.
I’m still getting the Invalid token error from Apple. I haven’t changed any other settings so I don’t believe I am trying to use a development token against Apple’s production Push notifications service, or vise-versa.
Can anyone suggest how to correct this? Thanks!
Possibly because Xcode cannot find a correct provisioning profile linked with with your app Bundle identifier and it is relying on its default profile.
In the menu go to: Xcode > Preferences > Accounts
Then click on View Details.. button to see all the provisioning profile associated with your account. Make sure you download them all so that Xcode can find them on your disk. Alternatively you can download your provisioning profiles from member centre on your mac and double click on them so that Xcode loads them internally.
I had to re-enable Push Notifications in the apps Capabilities.

iOS Parse Push Notifications in Adhoc exported ipa

I've an application which uses Parse.com push notification service. When I run app on my iPhone with xCode notifications are received well but when I install app with exported ipa with Itunes notifications aren't received.
What is the problem ?
It sounds like a provisioning profile problem. When you export the .ipa, it uses a particular provisioning profile, and that profile is different for Xcode and for ad-hoc.
To enable push for ad-hoc builds, you can find a detailed list of steps here: Enabling Apple Push Notifications for ad hoc distribution environment
I fixed the problem with creating "Production SSL Certificate" in my push notification identifier.

Resources