Unable to get FBNativeAd Test Ad working in our iOS App - ios

We have an iOS App (SWIFT 4) where we want to integrate Facebook Audience Network for Native Ad. Following the instructions at https://developers.facebook.com/docs/audience-network/ios (EXCEPT for entering "Payment info" in our Facebook Business account as we are in development phase still), https://developers.facebook.com/docs/audience-network/ios-native and https://developers.facebook.com/docs/audience-network/testing#testing-testAd our code (in ViewController viewDidLoad()) to load a TEST AD is as follows:
let nativeAd = FBNativeAd(placementID: "IMG_16_9_LINK#" + "OUR_PLACEMENT_ID" )
nativeAd.delegate = self
nativeAd.mediaCachePolicy = FBNativeAdsCachePolicy.all
nativeAd.load()
But FBNativeAdDelegate callback does not fire.
func nativeAdDidLoad(_ nativeAd: FBNativeAd) {
...
}
Using Facebook -> Manage Property -> Property Settings -> Ad Request Debugger, there is no request reaching the Server for reasons unknown. In our App "info.plist" file "App Transport Security" has property "Allow Arbitrary Loads" enabled (YES) just in case.
We have tried both Simulator on Mac as well as iPhone/iPad where Facebook App was logged in as the SAME user with the Business Account matching OUR_PLACEMENT_ID.
Any help to resolve the mystery will be highly appreciated.
Thanks!

It started working after set Key NSAllowsArbitraryLoadsForMedia to YES under App Transport Security in Info.plist! Note that this key will have to be manually added as it is not available as a default in XCode editor.
How I wish Facebook had clear documentation on this which would've saved 2 days of wasted effort!

Related

Xamarin forms how to log in with Apple account

I'm trying to publish my first xamarin forms app on IOS. I barred the issue of login with the Apple account.
I have 4 questions, please.
1- If I implement Sign in with Apple only for IOS 13+ will it be accepted? :(
2- I'm trying to use Xamarin Essentials to log in to IOS 13+ as shown in this article:
Xamarin Essentials
// Use Native Apple Sign In API's
r = await AppleSignInAuthenticator.AuthenticateAsync();
But I only get back the idToken. AccessToken, name and mail return null. Am I missing something?
3 - And finally I tried to use the plugin.firebaseAuth version 4.0.0-pre01:
Link plugin
// For iOS
var credential = CrossFirebaseAuth.Current.OAuthProvider.GetCredential("apple.com", idToken, rawNonce: rawNonce);
var result = await CrossFirebaseAuth.Current.Instance.SignInWithCredentialAsync(credential);
// For Android
var provider = new OAuthProvider("apple.com");
var result = await CrossFirebaseAuth.Current.Instance.SignInWithProviderAsync(provider);
It provides an example using prism to deal with this, but when I install the plugin in this version the application is no more than a splash screen and closes, without showing an error in the output. What am I doing wrong? :(
The first link seems promising for iOS less than 13 and Android using Asp.NET. However in the application I use only the Firebase ClouFirestone and Firebase Hosting for the Administrative Panel. Is it possible for me to sign in Apple without the services of a different backend?
I am very grateful for any light on the path I must follow
1- If I implement Sign in with Apple only for IOS 13+ will it be accepted?
It depends, if they don't find any other issues or violation, it will get accepted.
2- I'm trying to use Xamarin Essentials to log in to IOS 13+ as shown in this article: But I only get back the idToken.
Apple will only provide you the requested details on the first authentication. After that first authentication, you will only get the User Id so be sure to store the details that first time in case you need them.
This feature needs to be tested on a physical device running iOS 13. The simulator is not reliable, it doesn’t always work properly.
Should follow the design guidelines when implementing Apple Sign In. You can find it here: https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/

Account Linking redirect in Actions on Google simulator

I'm building an app utilizing the new Action on Google Java API. As I understand from dealing with account linking in Alexa, the initial flow (when the userId in the JSON request is null) should redirect to a sign in form to elicit user consent:
#ForIntent("RawText")
public ActionResponse launchRequestHandler(ActionRequest request) {
String userId = request.getAppRequest().getUser().getUserId();
String queryText = request.getWebhookRequest().getQueryResult().getQueryText();
String speech = null;
ResponseBuilder responseBuilder = getResponseBuilder(request);
if (isBlank(userId) || GREETING.equalsIgnoreCase(queryText)) {
speech = "I've sent a link to your Google Assistant app that will get you started and set up in just several simple steps.";
responseBuilder.add(
new SignIn()
.setContext(speech));
//...
return responseBuilder.build();
While testing in the AoG Simulator, however, I'm not seeing any redirection being done. I'm seeing the following error:
My account linking setup:
where authorization URL redirects to a local mock auth service which is supposed to display a login form. It's accessible (both via localhost and via ssh tunnel, provided by serveo.net reverse proxy in this case). Why Google doesn't redirect me there?
Can someone please guide me how to do this initial handshake in the account linking flow and where can I see the form which the Sign-In intent sent from the web hook is supposed to trigger?
I'd rather not use my phone, as the error message seems to suggest, as the account under which I'm testing in AoG simulator differs from my user ID on the phone.
What is meant by using Simulator as a Speaker? What is missing in my setup?
Is there another Google app that simulates the physical device better, similar to Alexa's simulator?
Normally, you can simulate the account linking, by selecting the Debug tab, there you will find a url, copy-paste it on another tab and you can link your account.
Once linking is done, go to the simulator and type 'cancel' or 'stop', and then 'Talk to speech bank'.
! Don't press reset or Change Version, or you have to re-link your app
But, recently Google has removed this url from debug tab, and I can't find it anywhere...
Simulator as a Speaker, The Surface Dropdown is set to Phone, you need to select Speaker,
but when you try that one, you will receive this error...
Invocation Error
You cannot use standard Google Assistant features in the Simulator. If you want to try them, use Google Assistant on your phone or other compatible devices.
So for the moment, you can't test an Action that needs account linking, using the simulator. You can do it with your smartphone...
UPDATE 2019-03-05:
Google has added the account linking in the simulator, which is now easier to test.

Does Facebook Deferred Deep Linking on iOS work, and how to test it before publishing the app on Store?

I have a problem with Facebook Deferred Deep Linking on iOS. DEEP LINKING WORKS, BUT DEFERRED DEEP LINKING DOESN'T WORK. I have read a lot about this problem and still cannot find the solution.
I have set up deep linking and it works. When I also try to test deep linking on App Ads Helper and click on "Test deep link", enter deep link and click on "Send notification", I receive a notification on Facebook which opens my app, and this deep linking works. But, when I click "Select Deferred", I don't receive anything. I try to delete app and reinstall it, but [FBSDKAppLinkUtility fetchDeferredAppLink:...]; method doesn't get any deferred deep link after new install.
[FBSDKAppLinkUtility fetchDeferredAppLink:^(NSURL *url, NSError *error) {
if (error) {
NSLog(#"Received error while fetching deferred app link %#", error);
}
if (url) {
[[UIApplication sharedApplication] openURL:url options:#{} completionHandler:^(BOOL success) {
}];
}
}];
In this example, url is always nil.
Note: I still don't have app on Store, so I entered a Apple Id of another application. Even if I had my own app on Store, how could I test deferred deep linking without publishing app on Store?
Also, I have read on Facebook documentation that:
Beginning with iOS 10, iOS doesn't support deferred deep linking, so you can't open content other than the starting screen once people have installed the app. (Source)
So, I am not sure if this is even possible.
Also, I have read another articles on Stackoverflow, but there are not answer that I am looking for, i.e. they look incomplete, or I just don;t see the answer between the lines:
How to use facebook deferred deep linking feature for new installs
and to test the same before publishing iOS App to appStore? -> Answers to this question aren't what I am looking for:
If you want to verify deferred links then check 'Send Deferred' in the dialog.
So, after doing this you need to uninstall the app(if already present) and then install again from the app store. The device in which you will be testing this should have facebook app installed and logged in with the account from which you had sent the "deferred deep link request" from app-ads helper.
Now when you open your app, you should bee able to see your deferred deep link functionality working.
This doesn't work, so that's why I am asking this question.
Also, I have found that I could use Tune SDK for deferred deep linking:
...this is not a problem with the iOS 10 operating system itself. Deferred deep linking works just fine for iOS 10 using the TUNE SDK. (Source)
Also, I have found that I could use Branch.io for deferred deep linking:
With Branch, you get all the basic routing of a Universal Link plus the deferred deep linking and install attribution for the new user acquisition flow. (Source)
I haven't tried Tune and Branch.io. I would like to use Facebook ads and perform deferred deep linking without third party solutions. Is it possible with Facebook, and how to test deferred deep linking for Facebook on iOS?
It worked for us after resetting advertising identifier. Maybe internally they are preventing attribution in the same app twice if it is the same advertising identifier. So go to settings and reset your advertising identifier before testing. Also make sure the phone has not opted out of tracking.
For me, the answer was in my iPhone settings. I had "Limit Ad Tracking" enabled. I don't have much documentation proof that this was causing the issue but after changing it, it is now working. It's worth testing it yourself.
On your iPhone go to: Settings -> Privacy -> Advertising (at the bottom of the page)
There you should ensure that "Limit Ad Tracking" is set to off.
You should then recieve a URL if you have your app URL Scheme correctly set (see here if not) code which for swift should look like this:
AppLinkUtility.fetchDeferredAppLink { [weak self] (url, error) in
guard let self = self else {return}
if (url != nil) {
} else if error != nil {
print("Error: \(error!.localizedDescription)")
}
}
To test the deferred links, you can go here.
A bit late, but per your comment on the previous answer: Once you receive the message:
The link has been queued and is pending you doing a first app launch on your device. This means you need to delete the app, then re-install and open your app. Please first verify your app can handle deferred deep linking by checking the iOS and Android setup information located above.
Delete the application from your device
Open Facebook notifications from your device, you should have a deeplink notification
Selecting the deeplink notification should direct you to the appropriate app store to install the application again
Once installed, launching the application should trigger the intended 'Deferred' deep link
For deferred deep link to work, you also need to be logged in on the Facebook app. The ads helper tool: https://developers.facebook.com/tools/app-ads-helper/ knows your logged in user id on facebook.com. Facebook then uses this info to match your id, the app and the device information and returns an appLink back to your app if so.
Unfortunately, that's not possible on simulator given the limitation to install other apps like Facebook.
Your only option is to use a real device and build your XCode project on it. Make sure you have Facebook installed and that you are logged in with the same user as on your desktop web browser.
If you are running Facebook ads with Deep linking enabled, you can test deferred deep linking setup here: https://developers.facebook.com/tools/app-ads-helper/
You will need to select your app, then you should be able to access the deep-link tester at the bottom of the page (in which you can also select deferred)
Additional info:
So you need to deploy the app to the store? – locoboy Aug 7 '15 at 16:38
For testing Deep Link or Deferred Deep Link as they said before me:
deploy to store not required, use FB Ads panel for testing
check just in case statistic for app installs (not equal zero) - may be AppEvents (automatically logged) doesn't work correct (keep in mind, in the calculation of statistics, there may also be a delay)
Install Facebook application for your device, auth in using the same profile that you use to send notifications (run FB app in background)
Select both 'Send Notification' and 'Send Deferred' check marks (or check only 'Send Deferred' - results will available after manual app reinstall, and don't forgot trigger FBSDKAppEvents activateApp)
Example after successful sending
The main objective - after sending the message you will see it in Facebook! app notifications, with logo + text "Tap to launch your deep link"
Tap on notification

iOS Facebook Account kit - Persist user token when app is opened 2nd time after successful login

My doubt is after successful login using Facebook account kit for the first time, I am reopening the app for the 2nd time. When I open how can I detect and use the existing user Access Token?
I tried by fetching Accountkit.currentAccessToken in appdelegate as a condition to show login page or welcome page. But currentAccessToken returns me null.
I have also enabled "Enable Client Access Token Flow" in app settings.
Kindly help to understand if my approach is right.
self.accountKit = AKFAccountKit (responseType: AKFResponseType.accessToken)
if(self.accountKit.currentAccessToken != nil)
{
//SHOW WELCOME PAGE
}else{
//SHOW LOGIN PAGE
}
I am facing the same issue in Android (not in iOS) but I think the problem is same, since in the document says it so.
this is my code for configuring the login using Email (kotlin, use let to change the val).
val configurationBuilder = AccountKitConfiguration.AccountKitConfigurationBuilder(
LoginType.EMAIL,
AccountKitActivity.ResponseType.CODE)
notice that the response type is AccountKitActivity.ResponseType.CODE
In the document says:
If you began the login session with AccountKitActivity.ResponseType.TOKEN, a logout option is available to remove the stored AccessToken from the device.
So the problem is on the Response type that I use, need to be changed into AccountKitActivity.ResponseType.TOKEN in order to make the token stored on devices.
I have seen some issues with Xcode8 / iOS 10 Simulators and keychain save/retrieval. See https://forums.developer.apple.com/thread/60617
AccountKit stores the accessToken securely in the keychain but there is an intermittent bug on Xcode8 / iOS 10 Simulators that makes read/write from keychain fail.
Can you test if this is also happening on a Device?
Apparently the problem goes away if you add the Shared Keychain Entitlement to your App, but this is still a bug on Apple.

"Login cancelled by player" callback in facebook api for Unity IOS (only if you have facebook app in device)

I am using unity facebook api 4.3.6 for ios. Its working perfectly fine if I don't have #facebookapp in my device. Once I download it and try login, it takes me to #facebookapp and redirect again to my game with callback
FB Login callback : {"is_logged_in":false, "user_id":"", "access_token":""}
Login cancelled by player
This happens only if I have facebook app downloaded! I think its some how cache issue but not sure exactly what is it. Any luck?
I believe this is not connected with Unity.
Here is few reasons I faced
You need to ask read and write permissions separately. Wait until you get read permissions than send request for write permission.
Make sure your app is allowed to login ( if you have FB app installed on your device )
Make sure you have your app bundle identifier added to developer.facebook.com
Here is what helped me fixed that problem with Unity Facebook-Android.
setting the sandbox mode ON:
Go to https://developers.facebook.com/apps
Select the respective app from the drop down.
Go to 'Status & Review' from the table in the left side of the page.
Do you want to make this app and all its live features available to the general public? - Select switch to set YES/NO value.
if the ON/OFF button is disable, please go back to Settings and enter a valid email address.
I understood why when the device is installed a facebook app, my app can't login facebook.
First : software OpenSSL create keyhass wrong. I have downloaded OpenSSL from here : http://code.google.com/p/openssl-for-windows/downloads/list , and it creates keyhash wrong.
I have used other OpenSSL sofware, you can download it here : https://www.dropbox.com/sh/t6tt44dc2nm6vza/6mp1W74GiZ , it is create keshash right.
Second: In class FacebookAndroidUtil.cs , line 62, you add System.Environment.GetEnvironmentVariable("HOMEDRIVE") before System.Environment.GetEnvironmentVariable("HOMEPATH"). Facebook SDK requires a file debug.keystore in : C:\Users\UserName.android\debug.keystore.
If the Unity Editor, Edit Setting Facebook has yet to create android debug hash key. Then use the Eclipse Software, create and run onr any project. Eclipse will generate a debug.keystore. If it is't create in folfer : C:\Users\UserName.android\debug.keystore , then find it, coppy and paste into C:\Users\UserName.android\debug.keystore
Third: publish your app in Facebook, so be sure it is:"This app is public and available to all users".

Resources