klippa-app/nativescript-login

accesessing Info.plist and Values.xml files

liamcharmer opened this issue ยท 13 comments

I've used the demo apps and copied literally the same Info.plist (then changed our the values). I put in the app.entitlement also. However when i try facebook login on both Android/iOS (and then google on iOS) they are not able to access the IDS /clients etc and aren't able to initailise the google SDK. (Google on Android works and Apple Sign in works on iOS).

Is there a new way of laying it out or something else I have to incorporate?

Hey! Did you try to ns clean after changing the Info.plist/Values.xml? And can you tell me what kind of errors you're receiving?

Hey! Did you try to ns clean after changing the Info.plist/Values.xml? And can you tell me what kind of errors you're receiving?

Hey!!! Really like the idea of this plugin and it's definitely me being silly probably.

So i've run ns clean and no luck.

Facebook login result:  {
  "ErrorCode": 0,
  "ErrorMessage": "Plugin error: Error: App ID not found. Add a string value with your app
   ID for the key FacebookAppID to the Info.plist or call Settings.shared.appID."
  }
 Google sign in result:  {
  "ResultType": 0,
  "ErrorCode": 0,
  "ErrorMessage": "Plugin error: Error: You must specify |clientID| for |GIDSignIn|"
  }

on iOS

on the iOS the info.plist is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>CFBundleDevelopmentRegion</key>
		<string>en</string>
		<key>CFBundleDisplayName</key>
		<string>${PRODUCT_NAME}</string>
		<key>CFBundleExecutable</key>
		<string>${EXECUTABLE_NAME}</string>
		<key>CFBundleInfoDictionaryVersion</key>
		<string>6.0</string>
		<key>CFBundleName</key>
		<string>${PRODUCT_NAME}</string>
		<key>CFBundlePackageType</key>
		<string>APPL</string>
		<key>CFBundleShortVersionString</key>
		<string>1.0</string>
		<key>CFBundleSignature</key>
		<string>????</string>
		<key>CFBundleVersion</key>
		<string>1.0</string>
		<key>LSRequiresIPhoneOS</key>
		<true/>
		<key>UILaunchStoryboardName</key>
		<string>LaunchScreen</string>
		<key>UIRequiresFullScreen</key>
		<true/>
		<key>UIRequiredDeviceCapabilities</key>
		<array>
			<string>armv7</string>
		</array>

		<key>UISupportedInterfaceOrientations</key>
		<array>
			<string>UIInterfaceOrientationPortrait</string>
			<string>UIInterfaceOrientationLandscapeLeft</string>
			<string>UIInterfaceOrientationLandscapeRight</string>
		</array>
		<key>UISupportedInterfaceOrientations~ipad</key>
		<array>
			<string>UIInterfaceOrientationPortrait</string>
			<string>UIInterfaceOrientationPortraitUpsideDown</string>
			<string>UIInterfaceOrientationLandscapeLeft</string>
			<string>UIInterfaceOrientationLandscapeRight</string>
		</array>
		<key>UIBackgroundModes</key>
		<array>
			<string>location</string>
		</array>
		<key>CFBundleURLTypes</key>
		<array>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>[i deleted it here]</string>
				</array>
			</dict>
			<dict>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>fb[[i deleted it here]]</string>
				</array>
			</dict>

		</array>
		<key>FacebookAppID</key>
		<string>[i deleted it here]</string>
		<key>FacebookClientToken</key>
		<string>[i deleted it here]</string>
		<key>FacebookDisplayName</key>
		<string>Streetify</string>
		<key>LSApplicationQueriesSchemes</key>
		<array>
			<string>fbapi</string>
			<string>fbapi20130214</string>
			<string>fbapi20130410</string>
			<string>fbapi20130702</string>
			<string>fbapi20131010</string>
			<string>fbapi20131219</string>
			<string>fbapi20140410</string>
			<string>fbapi20140116</string>
			<string>fbapi20150313</string>
			<string>fbapi20150629</string>
			<string>fbapi20160328</string>
			<string>fbauth</string>
			<string>fb-messenger-share-api</string>
			<string>fbauth2</string>
			<string>fbshareextension</string>
		</array>
	</dict>
</plist>

When i do ns clean then a fresh ios build

I do get the warning amongst it with:

Info.plist: Merging CFBundleURLTypes: Property CFBundleTypeRole is required! (Despite the above being my info.plist)

Not sure about the Info.plist error, but did you implement the wireInGoogleSignIn method?

When I open the iOS in xcode i can see the URL Types included in the target>app>info

Screenshot 2022-08-10 at 09 13 29

wireInGoogleSignIn

Not sure about the Info.plist error, but did you implement the wireInGoogleSignIn method?

... oh my lord i haven't. One moment let me do that, i'm gonna do a massive facepalm

That will not fix Facebook though, but it should fix Google

Maybe try to change the config to:

		<key>CFBundleURLTypes</key>
		<array>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>[i deleted it here]</string>
				</array>
			</dict>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>fb[[i deleted it here]]</string>
				</array>
			</dict>

		</array>

That will not fix Facebook though, but it should fix Google

fixed them both, I'm honestly so stupid I overlooked the wireIn stuff thinking it was another way to do the startWithSignIn stuff because I just ignored the app.ts file.

The facebook and google logins pop up, I think these are more me having to setup on the social media end but;

Google i get Error 400: Invalid_request, Custom Scheme URIs are not allowed for 'WEB' client type. (I think thats because i haven't generated an app specific login button?

Facebook i get Feature unavailable; Facebook Login is currently unavailable for the app.

For Google you need to create an Android login, not web.
For Facebook you need to activate Facebook Login in the app settings.

For Google you need to create an Android login, not web. For Facebook you need to activate Facebook Login in the app settings.

Honestly though this is perfect, thank you so much and sorry for taking your time for what happened was just me overlooking and rushing the documentation.

Thank you and sorry again

No problem! Good luck ๐Ÿ˜„