I want to create some Facebook Mobile App Ads but I found a problem with the installation of the Facebook iOS and Android SDKs. The main problem comes from step 2: https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads?locale=bg_BG#add-sdk when I have to add Facebook APP ID to my hybrid application.
Is it possible to set these APP_ID settings ?
Thank you :)
11 Answers, 1 is accepted
Thank you for posting to the Telerik Developer Forums.
Within a hybrid app built with Telerik AppBuilder you can use the Facebook SDK only through an Apache Cordova plugin, for example, the Facebook Connect plugin.
The AppBuilder-compatible version can be found here.
The plugin is not intended particularly for usage with Facebook Ads, but you can access the SDK through it. For example, import the plugin in your AppBuilder project and through the Data Navigator - open the platforms/ios/HelloCordova/Plugins/com.phonegap.plugins/facebookconnect and locate the FacebookConnectPlugin.m implementation file. Navigate to line 58 and in the applicationDidBecomeActive method you will be able to call the method referenced in the Facebook documentation.
In case you need to use specific methods and events from the SDK in your app, they need to be exposed from the JS API of the plugin (if they are not available in the plugin).
Let me know if this helps and if you have questions.
Regards,
Anton Dobrev
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
If not, I am getting: "ReferenceError: facebookConnectPlugin is not defined" error.
In other case, the "Error: init not called with valid version" error.
@ Zygimantas
Unfortunately the plugin is not available in the simulator. However, the error displayed in the simulator console should be handled which will be addressed in some of the next Telerik AppBuilder releases. Thus you will be able to test apps with custom plugins in the simulator (the functionality deriving from plugins will not work).
You need to test the app after deploying it on a connected device for best experience. Here you can read about the available debugging options on a device from within AppBuilder.
Please, let me know if you have further questions.
Best regards,
Anton Dobrev
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
Thanks for your input.
You are right, the built-in AppBuilder simulator does not provide a support for custom Cordova plugins. The functionality included majority of the Cordova API plugins is mocked up in the simulator implementation. Thus in the simulator you can open a library of images, open a file, rotate the device orientation, simulate geolocation and network information.
Because the Facebook plugin is essentially a custom plugin that provides a functionality that relies on the native Facebook SDKs for the given platform, it is not available in the simulator. Basically this version of the plugin available in the Telerik Marketplace is modified to be easily used within an AppBuilder project, to be able to build it with the AppBuilder build services and ultimately, provide a native Facebook integration in your mobile app.
Given that we always recommend testing on real devices your app as the most correct way to test your app during its development lifecycle, there is a LiveSync feature – you do not have to redeploy the app every time, unless you have made some project-critical changes that cannot be LiveSynced (refer to the link above for a list of them). Debugging on device and using the native emulators expand further the options available to your testing process.
Let me know if you have further suggestions or considerations.
Edit - I edited the styles (font color) of the post.
Regards,
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
I completely understand your frustrations. Our simulators do mock the core Cordova plugins today and we are considering mocking certain custom plugins going forward. As you can imagine though, mocking all of the possible native device features is a significant technical task.
I can suggest that with the Facebook plugin, I have heard of many people utilizing (and sometimes favoring) the Facebook JavaScript SDK: https://developers.facebook.com/docs/javascript
This will work fine in the simulators. We are also working on some features that will bridge that gap that exists between the simulators and testing on a device - stay tuned!
Regards,
Rob Lauer
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
That is understandable. I completely understand it takes time to put things into a product like this. I think that will be a great addition to your product.
FYI - I am using the Facebook JavaScript SDK. It works great for retreiving and such. I am not a big fan of the login process. Works great 99% of the time. Every once in a while gets to a blank white page that says sign in. I think I might put an if statement in to see if I am in the simulator or not and use the Cordova plugin for login to get the key. Then use the JavaScript for retrieval of feed information. That should give me the professional login interaction I am looking for.
Thank you for input, indeed, you may consider to use the JS SDK when testing in the simulator and use the plugin in the production app package in order to provide the best user experience to your customers.
Please, let us know if you have further questions or suggestions.
Regards,
Anton Dobrev
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.