Google Sign-In 404 Error with swift - ios

link: Simulator Screenshot of Error
Hello,
I just had my laptop repaired/reset after some water damage and now when opening the app on Xcode 9 Beta and pressing the "Google Sign-in" button the link fails to sign in. This used to work perfectly before 3 weeks ago on Xcode 8 before the water spill incident so I'm not sure what's going wrong.
I tried submitting the failed link myself and that's where I got the 404 HTTP Request error.
I also checked to make sure that GoogleService-info.plist matched with what's on firebase and I made sure I reregistered the signing of this app to my appleid.
Any help would be appreciated. Thanks in advance.

I had the same issue please check following things: -
check console.developers.google.com/apis/credentials for your project and see whether there is already a client_id in OAuth 2.0 client IDs section , if so then copy that client id and replace it with you GoogleService-Info.plist file's CLIENT_ID and accordingly change REVERSED_CLIENT_ID (in reverse manner) now clean and build your app and test it will work

It seems that you might have not add a URL scheme to your project
If you do not add a URL scheme into your, Follow some step to add
Open your project configuration: double-click the project name in
he left tree view. Select your app from the TARGETS section,
then select the Info tab, and expand the URL Types section.
Click the + button, and add a URL scheme for your reversed client ID. To find this value, open the GoogleService-Info.plist configuration file, and look for the REVERSED_CLIENT_ID key. Copy the value of that key, and paste it into the URL Schemes box on the configuration page. Leave the other fields blank.
Note: Don't foget to check your client_id

Related

Struggling with XCode Settings for ios deeplinking on flutter

My app should open when someone clicks on a link like:
https://catalogscanner.horizonpedia.com/P7GWqM6ADnG
This works on my android phone so I assume that I have done everything correctly on the coding site. (I am using https://pub.dev/packages/uni_links for that)
So I started by adding the domain to my runner.entitlemens as you can see.
The Target Membership category shows that there is runner not ticked:
When I tick the box and start the build, it fails with the error message below:
To fix this, I have to remove the info. plist from the "Copy Bundle Resources" from my "Build Phases" Section:
If my understanding is correct then The target membership of the runner entitlement should be the Runner, shouldn't it?
Can I try other things to troubleshoot?
Neither of those files should need to have their Target Membership checkbox checked. These checkbox mainly applies to source files such as typical Swift files (.swift) or Objective-C implementation files (.m) for example.
They should not also be part of the Copy Bundle Resources phase. You just should ensure that in the Build Settings pane of your app target, the Info.plist file is correctly set like below:
Regarding the Universal Link support, you first have to be sure that the apple-app-site-association file you uploaded is correctly formatted (I just checked via your domain and it seems to be invalid JSON as my browser Firefox told me that it had issues parsing it; you can also look for AASA validator online that will confirm this).
The process is the following: when iOS will install your app, it will look for the domain you mentioned in your .entitlements file. Then it will retrieve the AASA file from this specified domain and register your app as a handler for those link. Then, if you happen to browse or click to/on a link matching the paths you specified in the AASA file, then your app should launch and you'll have appropriate callbacks in your application delegate where you can intercept the link and take appropriate actions.
If you want more information about Universal Link support, you can look on Apple developer documentation.

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.

How to sign BoxContentSDK.framework?

I used Carthage to build the BoxContentSDK.framework. Everything runs in the simulator and on device. When I go to submit to the app store, I get the error that the BoxContentSDK.framework is not signed. The framework is added in the embed frameworks section of the project and code sign on copy is set. The logs say: BoxContentSDK.framework: replacing existing signature, then BoxContentSDK.framework: code object is not signed at all
Any help appreciated.
Found the answer. You need to do additional work besides just adding the framework. The BOX SDK page links to the wrong page. Here is the correct page:
https://github.com/Carthage/Carthage/blob/5fd867c4895b4f59d70181dec169a1644f4430e3/README.md#if-youre-building-for-ios

Can't download GoogleService-Info.plist file

I'm trying to setup Google Analytics for my new iOS app, when following the instructions here.
It instructs me to click the "Get A Configuration File" button, but that button just sends me to another page that has a spinning, nothing ever happens. I already have a property setup in Analytics for web and a view setup for mobile.
Can anyone share the GoogleService-Info.plist file with me so I can attempt to manually fill in the details of the file and add it to my project?
It happened with me also. If you close everything and follow that link it worked for me next time. You can try to do that. Below is the link of sample plist file, of course I replaced tracking id, bundle id and app id to strings from original values. Hope it helps.
Sample Google Plist file
Generally in iOS
1) Create your project in Firebase console https://console.firebase.google.com
Click add project and follow steps.
2) Now open this link to get GoogleService-Info.plist file
https://developers.google.com/mobile/add
-->Click Get Started
-->Select your project
Ex: CloudFirestoreSwift
--> Now select domain Ex: iOS
-->Now add app bundle id then GoogleService-Info.plist file will be generate, download it and complete the steps if required.
NOTE: Please don't change file name. It's must be GoogleService-Info.plist
If you already generated GoogleService-Info.plist file. Now select your project and go project settings.
--> Go General tab, you can find GoogleService-Info.plist file here download it.
Steps for getting configuration if your first time login to google developer account.
1. Open google developer console.
2. Login to developer console.
3. Create project with valid name.
4. Enable google analytics.
5. Then get the configuration file.
The download link is not always immediately visible and you have to scroll up to get it, I happen to press next before downloading and I missed the opportunity to download the file.
I prefer the automatically generated file as I am lazy (aren't we all)
So, follow these steps
Go to https://developers.google.com/analytics/devguides/collection/ios/v3/
Scroll down to Get a configuration file
When prompted for the app name and bundle Id, just use the drop down menu and you'll find your previously created app details there.
Proceed to the next screen Continue to: Choose and Configure Services
Select your service, note that your previously selected ones will have a green arrow (Analytics in the case below)
Select Generate configuration file
You'll be given an opportunity to download the file again.
Voila!
You need to login on https://console.developers.google.com create your first application, then go back to https://developers.google.com/mobile/add the website will now work correctly.
Installing Ignore X-Frame headers plugin on Chrome made this bug vanish
Same here, I got following invalid json file:
)]}'
{"status":401,"message":"Invalid authuser parameter"}
and that is resolved by clearing cookies on google.com on your browser.
Thanks to Sanjana I decided to look at Google's web code and found they have an X-Frame error.
So the url you can visit is https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…collection/ios/v3/app?configured%253Dtrue&hl=en#add-config&cntlbl=Continue

Uncaught NSInvalidArgumentException when using Google Sign In for iOS

I tried today to upgrade to Google Sign In for iOS (we have an existing app built against Google+ Sign In).
I followed the getting started guide to build the configuration out, and added my proper URL schemes (for instance, the app's client ID).
Upon launching the app and attempting sign in with Google, I get the following uncaught exception:
2015-06-09 03:43:23.800 <appname>[238:7171] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'Your app must support the following URL schemes: (null)'
The exception occurs outside of our control, between GIDSignIn.signIn and GIDSignIn.delegate.signIn.
Is there anything I can do to fix this?
What's going on is that the Google SDK is retrieving your client configuration from the dictionary in GoogleService-Info.plist but it most likely is not finding any configurations or is not able to find the file.
When you call [[GGLContext sharedInstance] configureWithError: .., e.g.:
NSError* configureError;
[[GGLContext sharedInstance] configureWithError: &configureError];
The code parses your client ID from the Google-ServiceInfo.plist file, which you should add to a supporting files or other shared resources folder, and then checks that you have also added a URI for the reversed client ID, which is pulled from the plist dictionary.
First of all, if you don't have this file, generate it by following the wizard on the new Enable Google services for your app page.
Next, make sure that you're copying the GoogleService-Info.plist file as a resource in your Xcode project in the build phases section. When you have successfully added it to your project (usually best added in a Shared Resources section) the error message will no longer indicate a null URI is required.
Finally, make sure that you have added the bundle ID and reversed client ID in your application's URLs - which should be easy to do because the error message will tell you what's missing at this point.
If all this is still giving you trouble, you might want to try Google Sign-In for iOS using the quickstart sample by running:
pod try Google
And starting from the SignInExample.xcodeproject sample...
Once go through with this :
Here you'll get all about URL Scheme problem
Add the configuration file to your project
Drag the GoogleService-Info.plist file you just downloaded into the root of your Xcode project and add it to all targets.
Add URL schemes to your project
Google Sign-in requires two custom URL Schemes to be added to your project.
To add the custom schemes:
Open your project configuration:
1. double-click the project name in the left tree view. Select your app from the TARGETS section,
2. then select the Info tab, and expand the URL Types section.
3. Click the + button, and add a URL scheme for your reversed client ID.
To find this value, open the GoogleService-Info.plist configuration file,
4. and look for the REVERSED_CLIENT_ID key. Copy the value of that key,
5. and paste it into the URL Schemes box on the configuration page.
Leave the other fields blank.
6. Click the + button, and add a second URL scheme.
This one is the same as your app's bundle ID.
For example, if your bundle ID is com.example.app,
7. type that value into the URL Schemes box.
8. You can find your app's bundle ID in the General tab of the project configuration (Identity > Bundle Identifier).
Wait ! Update iOS 9+
In iOS 9 you must whitelist any URL schemes your App wants to query in Info.plist under the LSApplicationQueriesSchemes key (an array of strings)
so you need to add under LSApplicationQueriesSchemes, your bundle id and the reverse id in Google-ServiceInfo.
I search for a long time and google doc doesn't mention it yet ...
my app crashed everytime in appDelegate until I add these lines in info.plist...
Starting from iOS9 you have to set 4 (four) values to your info.plist file.
URL Types
Select your target app in Project Settings
Select info on top bar
Scroll down to URL Types
Add a URL type
Fill out URL Schemes using the REVERSED_CLIENT_ID key from your GoogleService-Info.plist file, leave other fields as they are
Add a 2nd URL type, this time with your application bundle id from General tab
LSApplicationQueriesSchemes
Add a new Target Property named LSApplicationQueriesSchemes. Should be a type of array.
Add one item equal to the REVERSED_CLIENT_ID value
Add a second item with your app bundle id again
Compile and enjoy.

Resources