Ionic iOS App Error - Custom Scheme URIs are not allowed for 'WEB' client type - ios

I am using this plugin.
https://github.com/EddyVerbruggen/cordova-plugin-googleplus
The implementation works fine for android. But google sign in on iOS opens safari webview and throws 400 invalid_request.
I am using the ios client id and reverse client id generated on google developer console.
Anyways to debug or know what the issue is?

The usual cause of this error is having an incorrect REVERSE_CLIENT_ID. Double check that you have the REVERSE_CLIENT_ID from the plist file downloaded when you set up the iOS application registration on the Google developer console. Note that if you got it wrong, changing this is difficult, as it gets copied into various locations and won't update automatically if you just try to change it in config.xml. When I mistakenly used my Android client ID to set up the plugin, I found that as well as config.xml I also needed to change the top level package.json file, and the <appname>-Info.plist in the platforms/ios directory in order to get the correct ID used.

Related

Can't get debug token for Firebase App Check for my Flutter iOS App

So I recently started setting up app check for my existing Flutter project (for both android and iOS platforms). I've had no problem with android's "Play Integrity", got the necessary debug token, and can successfully send and retrieve data to/from firestore (app check for firestore is currently enforced for my project).
The problem is, I can not get such a debug key for my iOS app. I will list the sources I've used and what I've tried so far.
I have firebase_app_check: ^0.1.1+8 installed via pubspec.yaml
I also added pod 'FirebaseAppCheck' to my Podfile
I have the necessary initialization code in my main.dart: await FirebaseAppCheck.instance.activate(...);
For "DeviceCheck", I am using THE SAME private key that I am using
for "Sign in With Apple" (which I have implemented successfully). I
have also enabled the checkbox for DeviceCheck in the settings of
that private key (in Apple Developer).
For my App ID (Apple Developer > Identifiers > App IDs), I have also
enabled the checkbox for "App Attest".
I have put "-FIRDebugEnabled" as an argument passed on launch in
XCode > Product > Scheme > Edit Scheme.
I always uninstall my app from my iOS simulator (iOS 16.2) or real device (iOS 16.1.2),
before trying again, because I have read across multiple forums that
the debug token only gets printed to the output the first time you
run your app.
I have also added these 4 lines of code in my AppDelegate.swift from here:
#if DEBUG
let providerFactory = AppCheckDebugProviderFactory()
AppCheck.setAppCheckProviderFactory(providerFactory)
#endif
Official firebase docs "iOS+ (App Attest)":
I have NOT copied ANY code from this page of the official docs, as I assume it's for native iOS apps only, and not for flutter, and I don't know where exactly I would have to put that code. I have only added the pod dependency and run pod install.
I don't have a .entitlements file.
So after all those steps, I'm apparently supposed to expect to find a debug token in my run output, as in:
Yet the only relevant output I can find is the following:
Runner[72719:33546579] 10.3.0 - [FirebaseFirestore][I-FST000001] AppCheck failed: 'The operation couldn’t be completed. (com.apple.devicecheck.error error 1.)'
If it matters:
I have NOT YET uploaded my iOS app to apple developer, app store connect or whatever (I'm not yet familiar with the process of publishing to the app store).
Neither have I uploaded my android app to Google Play console or created an app there (for this project).
Don't tell me anything about firestore rules. I already had that set up long ago, and everything worked just fine before I started integrating App Check.
Don't recommend any 3rd party plugins to me, I will only use official ones.
The firebase documentation says:
Tip: Confirm in your Xcode project's build settings that it passes the DEBUG flag to the Swift compiler
Try removing the '#if DEBUG' and '#endif' and run the app.
If it works, it mean you have missed that step
I was not able to find that build setting, so i just removed those lines from the AppDelegate, but i need to keep in mind to remove the other 2 lines while building the release mode
See this answer on the flutterfire Github issues page. Basically, call setAppCheckProviderFactory before GeneratedPluginRegistrant.register(with: self) in the app delegate file. I was investigating the same issue and it fixed it for me (the debug token was instantly printed out in Xcode's debug output). Hope it helps you as well!

ios Firebase Dynamic Link not opening installed app

I've looked at other previous questions about this topic, and I haven't found the solution for my problem.
I've followed this Getting started with Firebase Dynamic Links on iOS, however if I click on the universal link for testing, https://appName.page.link, I get the following message:
Invalid Dynamic Link
Requested URL (https://appName.page.link/) must be a parsable and complete DynamicLink.
If you are the developer of this app, ensure that your Dynamic Links domain is correctly configured and that the path component of this URL is valid
The previous message makes me think that the created page created by Firebase is created yet, however when I visit the page:
https://appName.page.link/apple-app-site-association, I get the following data:
{"applinks":{"apps":[],"details":[{"appID":"TeamID.com.example.appName","paths":["NOT /_/*","/*"]}]}}
This means that the page has been successfully created.
I have verified that the TeamID has been set properly set in the Firebase settings, and also that the TeamID is the same from XCode and from the Apple developer account.
The URLSchemes, set in Xcode is com.example.appName and inside the Signing & Capabilities in the Associated Domains has the domain: applinks:appName.page.link
Is there anything that I'm missing to configure?
I ran into this issue as well following the video. If you continue in the video he mentions that there is a bug for iOS where you might need to completely uninstall the app, restart your device, and then reinstall the app.
for reference:
https://youtu.be/KLBjAg6HvG0?t=532
Did you created dynamic link here? Firebase > Dynamic Links > New Dynamic Link. Your link should looks like https://AppName.page.link/shareLink
I think this behavior is expected, clicking on the URL prefix (https://appName.page.link) without any path will not take the user to the app since the configurations (deep linking, campaign tracking, platform behavior, etc) is not set up yet.
But once you create a new link along with the prefix (e.g. https://appName.page.link/createdLink), it should work properly.
The bit that tripped me up was that I added "Associated Domains" to the "Release" tab instead of the "All" tab. So when I was running on my app, I'd also get the Invalid Dynamic Link error.

React native IOS app web-services works on simulator but not real IOS device

I have done with all the settings of my react native project and trying to run on the IOS simulator, it's working fine. Means all the api working properly.
So now I have to share my .ipa file to team members for testing, so creating .ipa file I am using procedure defined on react nativeRunning On Device documentation.
For creating .ipa file using Xcode following below process:-
In Edit Scheme option, change Build Configuration to release.
Clean Build Folder
Create Build.
Archive build.
After that exporting .ipa file using valid certificate.
Solutions I have tried:-
Checked with this solution, because the domain I am using to hit web service is not secured.(It's http)
Enable Transport security flag.
Added main.jbundle (created using command line) to Copy Bundle Resource option in Build Phases.
While adding Alert in api call, getting below error (check image)
Still No luck.
Please let me know, what I am doing wrong?
Please check api server live link is working or not. In my case, I am testing whole api's on local network (In LAN). But when trying with live url, I am also facing this issue.
So that time I made one mistake, that my url should contain http:// but in actual it was https://.
It's pointing to main.jsbundle file, that means it's having issue
related with your code.
So check it once.

Unable perform google plus sign in ios using ionic 2

Hi i am applying social login scenario in my ionic app where i applied google sign option and it is working perfectly with android and when comming to the ios im getting the below error
the api key and bundle id everything are set and working perfect
You have to follow the below steps as configuration for google login through IOS
Go to https://developers.google.com/mobile/add?platform=ios&cntapi=signin for IOS registration
Enter IOS bundle Id from widget Id in config.xml of the project
Enable Google sign In and generate configuration file
Copy the reverse client Id from downloaded file
Install the plugin with reverse client Id instead of webclient Id which we used for Android
run cordova plugin add cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID="myreversedclientid"
We can find the reverse client Id in Google developer console also credentials->iOS URL schema is the reverse client Id
Extract from Plugin documentation
To get your iOS REVERSED_CLIENT_ID, generate a configuration file
here. This GoogleService-Info.plist file contains the
REVERSED_CLIENT_ID you'll need during installation. This value is only
needed for iOS.
The REVERSED_CLIENT_ID is also known as the "iOS URL Scheme" on the
Developer's Console.
Login on iOS takes the user to a SafariViewController through the
Google SDK, instead of the separate Safari browser.
IMPORTANT:
Please note that myreversedclientid is a place holder for the reversed
clientId you find in your iOS configuration file. Do not surround this
value with quotes. (iOS only Applications)
If you are building a hybrid application (iOS and Android), or an
Android application, you have to replace myreversedclientid with the
reverse value of Client ID in your Release credential generated on
step 3, on Google Developer's Console, this will be:
"com.googleusercontent.apps.uniqueId", without quotes.
1)Go to firebase console in your project add for ios.
2)you can see the google-info-plist file download it.
3)in this plist file have webclientid and reverseclientid use this
in package json file where google plus varible of webclient id and reverseclient id.same
as in config.xml file then after.
4)run commnad ionic cordova prepare ios then ionic cordova build ios
5)buy beer for me :)

Publish Android Application does not work

Just created an .apk with the Publish Android Application option, created a keystore with key and uploaded to the Google Play app store. Everything worked, but when I tried to download the app from the app store i got an error message resembling "The application has an incorrect signature". I thought the "Publish Android Application" part of Xamarin.Studio was supposed to fix everything?
I ran the following command on the .apk afterwards: jarsigner -verify -verbose -certs app.apk At the bottom it said the following: This jar contains entries whose certificate chain is not validated.
Please help, would love to have the app out today :)
My problem was simple. XamarinStudio was setup to use Java1.7, setting it to use Java1.6 fixed it :)

Resources