My iOS application requires multiple Facebook Applications. But, since we have to put the application ID and client ID on the info.plist file. So, it's impossible to switch or change the application ID without a dynamic way.
As per facebook documentation (https://developers.facebook.com/docs/reference/ios/3.24/class/FBSettings/), I found there is a method named setAppID/setDefaultAppID. Through this, I should be able to change the Facebook application ID dynamically. But, in the FBSDKCoreKit package, there are no such methods.
I tried:
FBSDKCoreKit.Settings.setAppID("appID") [No such method]
FBSDKCoreKit.Settings().setAppID("appID") [No such method]
FBSDKCoreKit.Settings.appId = "appID" [Doesn't work]
FBSDKCoreKit.Settings.shared.appId = "appID" [iOS application crashes]
Related
I want to know when using firebase_admob, do I need this code?
If so, when releasing an app, what should I write for keywords, contentUrl, and testDevices?
I mean, when releasing an app, testDevices is even necessary?
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
keywords: <String>['flutterio', 'beautiful apps'],
contentUrl: 'https://flutter.io',
birthday: DateTime.now(),
childDirected: false,
designedForFamilies: false,
gender: MobileAdGender.male, // or MobileAdGender.female, MobileAdGender.unknown
testDevices: <String>[], // Android emulators are considered test devices
);
this information is used to show ad to users.
You should use keywords related to your application. Ex: if Your application is related to hospital then you can use medicine as your key words.
you can add you web site url if you develop any web site for particular application as contentUrl .
testDevices is a Id of you device in which you are tested. if you want to test your application in real device then you must add test device id because it help you to avoid ad mob bane.
MobileAdTargetingInfo class properties mirror the native AdRequest API.
You will find more information about those properties in the documentation for AdRequest.Builder and RequestConfiguration.Builder.
AdRequest.Builder
public AdRequest.Builder addKeyword (String keyword)
Add a keyword for targeting purposes.
public AdRequest.Builder setContentUrl (String contentUrl)
Sets the content URL for a web site whose content matches the app's primary content. This web site content is used for targeting and brand safety purposes.
At the time of writing some parameters from the question have been deprecated with no alternative, some like the one below replaced with a different approach, while some other moved to RequestConfiguration.Builder.
public AdRequest.Builder setIsDesignedForFamilies (boolean isDesignedForFamilies)
Deprecated. Use Ad Content Filtering.
RequestConfiguration.Builder
public RequestConfiguration.Builder setTagForChildDirectedTreatment (int tagForChildDirectedTreatment)
This method allows you to specify whether you would like your app to be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA)
public RequestConfiguration.Builder setTestDeviceIds (List testDeviceIds)
Sets a list of test device IDs corresponding to test devices which will always request test ads. The test device ID for the current device is logged in logcat when the first ad request is made.
If I have an application ID for an app on the iOS App Store, how can I find the package name?
For example, if I know the application ID is 457446957, how can I find out what app this is (Jetpack Joyride, in this case):
https://itunes.apple.com/us/app/jetpack-joyride/id457446957?mt=8&isWebExpV2=true&dataOnly=true
Return all information about application(include package name)
https://itunes.apple.com/lookup?id=
You don't actually need the package name to load an App Store page, just the ID. So for your above example, if you load:
https://itunes.apple.com/us/app/id457446957
you'll get the App Store page for that app and could grab the package name using web-scraping. In this example,
h1.product-header__title product-header__title--app-header
contains the text:
Jetpack Joyride
I'm trying to implement twitter integration for my iOS app and my apps deployment target is 4.0 & greater, I'm using bengottlieb sample for twitter share, In my twitter app page in Callback URL: text field When I don't set callback url in app settings my app is crashed! (authenticatedWithUsername delegate method is getting called but it is dismissing the view controller)What callback url I must set?I want to return to the app after authorization?
You just have to provide any valid URL at the Settings -> Callback Url.
I have used "https://www.google.com" and my app start working.
Also, remember to unchecked the Enable Ca Callback Locking
I know this might sound a very basic question but I am having an issue in using Facebook SDK for Blackberry. I have downloaded the latest one 0.8.25. I have imported them in my eclipse and they are present in the referenced libraries. I have a game app where I want the users to login using their facebook account. Which class contains the code for logging in? Are the jar files implementable or they are just for reference? I have read forums posts where users say that they executed Strawberry program but I can no where find any executable source code. Kindly please let me know how do I create a login page for BlackBerry using its SDK. I did go through another link of Sample Code here!
Let me know which class has login code or how do i use the SDK
At the very basic least, you need to get an instance of the Facebook object and call getCurrentUser(). So, for example:
String[] permissions = new String[] { Facebook.Permissions.ALL_PERMISSIONS };
Facebook fb = Facebook.getInstance(new ApplicationSettings(myNextUrl, myAppId, myAppSecret, permissions));
User fbUser = fb.getCurrentUser();
The code in the library will handle all of the details like getting the user to login to facebook account and accept the requested permissions and so on. You'll want to wrap that all in a try/except to catch FacebookException for error conditions (e.g. user refuses your request).
I have a free and a paid version of the same iPhone app. I would like for them to share a Facebook App ID since they are essentially the same app. I thought I could accomplish this by using this method from the Facebook class.
- (void)authorize:(NSArray *)permissions localAppId:(NSString *)localAppId
However, login always fails for one of the apps (in my case the free version) and it would seem that the reason is that the Facebook app created in the web interface asks for an App Bundle ID and App Store ID. Obviously the free version and paid version of my apps cannot have the same bundle id or app id so how can I make this work?
The docs in Facebook.m suggest that it is possible with the authorize method I mention above:
/*
* ...
* #param localAppId
* This is useful if your have multiple iOS applications that
* share a single Facebook application id (for example, if you
* have a free and a paid version on the same app) and you want
* to use SSO with both apps.
* ...
*/
Thanks.
- Alex
You can make it work. Each app must have different url schemes (since that is how Facebook redirects back to your app).
Example url schemes you must support:
(Your facebook app id: "fb123456789")
Without setting localAppId: "fb123456789" (localAppId = nil)
Free app url scheme: "fb123456789lite" (localAppId = "lite")
Paid app url scheme: "fb123456789pro" (localAppId = "pro")
From the comments:
localAppId is a string of lowercase letters that is appended to the
base URL scheme used for SSO. For example, if your facebook ID is
"350685531728" and you set localAppId to "abcd", the Facebook app will
expect your application to bind to the following URL scheme:
"fb350685531728abcd".