floatinghotpot / cordova-plugin-facebookads

Cordova/PhoneGap plugin for Facebook Audience Network Ads
65 stars 71 forks source link

How to find Facebook Device Hash ID for Testing #15

Open jason-engage opened 9 years ago

jason-engage commented 9 years ago

Hi, I had the FacebookAds plugin working for a couple of days on my test app. I used a random series of number and letters for the 'adId' and set 'isTesting:true'. However I tend to rebuild my app in Xcode alot and now I'm receiving 'error 1002,Ad was re-loaded too frequently' in the console and the facebook ads won't show anymore. There are also server error 2000 in the console.

I've tried changing the adId to something else but that doesn't work. I don't have any official banner id from facebook audience network since I have to submit my app store links, which I do not yet have.

I noticed that I didn't have a deviceHash set, maybe that would prevent issues while I test my app. However, how do I find the device hash? Do I set deviceHash: device.uuid?

Does anyone have a solution for easily testing facebookads on ios (and android), without applying for and setting up their Facebook audience network?

manuelpaulo commented 9 years ago

Best way is keep an eye on the logs. The SDK will automatically post this:

D/AdSettings﹕ When testing your app with Facebook's ad units you must specify the device hashed ID to ensure the delivery of test ads, add the following code before loading an ad: AdSettings.addTestDevice("12345678901234567890");

jason-engage commented 9 years ago

@manuelpaulo Can you walk me thru the steps to get there? I don't have the facebook SDK. I'm using javascript cordova to build and Xcode to run on my device. Which log file do I find it in? What's the path?

manuelpaulo commented 9 years ago

Create a cordova project and add the FacebookAds plugin. Run on xcode or android studio targeting your device and keep an eye on the log window below. You will notice a message with the correct hashtag of your device.

manuelpaulo commented 9 years ago

Also, the 2000 error is related to your own app id. Be sure it is correct and approved by FB. The id on the demo code of the FB Ads plugin used to work, but not any longer.

jason-engage commented 9 years ago

@manuelpaulo Thanks, but I don't see any facebook ads log entries in my Xcode 6.4 console, as I start up the app on my device. There are a few entries that I'll paste below. I do not have an approved FB app id. It seems to require an app store link, which I do not yet have, because my app is not yet submitted to an app store. I was hoping to test FB ads before submitting.

2015-08-05 12:28:38.750 videotut[22910:3607128] Apache Cordova native platform version 3.8.0 is starting. 2015-08-05 12:28:38.752 videotut[22910:3607128] Multi-tasking -> Device: YES, App: YES 2015-08-05 12:28:38.769 videotut[22910:3607128] Unlimited access to network resources 2015-08-05 12:28:38.984 videotut[22910:3607128] Using a WKWebView 2015-08-05 12:28:39.148 videotut[22910:3607128] [CDVTimer][keyboard] 1.156032ms 2015-08-05 12:28:39.149 videotut[22910:3607128] [CDVTimer][admob] 1.052022ms 2015-08-05 12:28:39.189 videotut[22910:3607128] [CDVTimer][file] 39.623976ms 2015-08-05 12:28:39.277 videotut[22910:3607128] [CDVTimer][splashscreen] 87.433994ms 2015-08-05 12:28:39.449 videotut[22910:3607128] [CDVTimer][socialsharing] 171.660960ms 2015-08-05 12:28:39.452 videotut[22910:3607128] [CDVTimer][TotalPluginStartup] 306.290030ms [DEBUG] Did open IPv4 listening socket 7 [DEBUG] Did open IPv6 listening socket 8 [INFO] GCDWebServer started on port 12344 and reachable at http://localhost:12344/ 2015-08-05 12:28:39.462 videotut[22910:3607128] Started http daemon: http://localhost:12344/ 2015-08-05 12:28:42.318 videotut[22910:3607128] THREAD WARNING: ['carrier'] took '56.209961' ms. Plugin should use a background thread.

floatinghotpot commented 9 years ago

It seems that the facebookads plugin correctly, so you will not see any log from it.