{ "id": "148046", "key": "TIMOB-19626", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2018-01-23T13:58:52.000+0000", "created": "2015-05-21T01:28:02.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "ads", "android", "facebook", "ios", "module", "titanium" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-08-02T22:20:02.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "Current Facebook Module missing support for FB Audience Network for iOS and Android as indicated on facebook at:\r\n\r\nhttps://developers.facebook.com/docs/audience-network/getting-started#ads_sdk\r\n", "attachment": [], "flagged": false, "summary": "Add FB Audience Network Support to Facebook Module", "creator": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "environment": "Ti Android, iOS, Facebook Module", "closedSprints": [ { "id": 1058, "state": "closed", "name": "2018 Sprint 16 SDK", "startDate": "2018-07-29T22:26:06.486Z", "endDate": "2018-08-12T22:26:00.000Z", "completeDate": "2018-08-13T17:38:16.757Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "353631", "author": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "body": "Facebook iOS Banner Instructions:\r\n// Import the SDK header file and declare that you are implementing \r\n// the FBAdViewDelegate protocol:\r\n#import \r\n\r\n@interface MyViewController : UIViewController \r\n // Other code might go here...\r\n@end\r\n \r\n// In your View Controller, create a new instance of the FBAdView\r\n// and add it to your view hierarchy:\r\n- (void)viewDidLoad\r\n{\r\n [super viewDidLoad];\r\n\r\n FBAdView *adView =\r\n [[FBAdView alloc] initWithPlacementID:@\"347360645445128_445223535658838\"\r\n adSize:kFBAdSize320x50\r\n rootViewController:self];\r\n\r\n adView.delegate = self;\r\n\r\n [adView loadAd];\r\n\r\n // Reposition the adView\r\n // ... \r\n\r\n [self.view addSubview:adView];\r\n}\r\n\r\n// Now that you have the basic code running, it is recommended that you use \r\n// the FBAdView delegate to get notified when the ad fails to load so you \r\n// could hide the banner unit. In the same way, you can add it back when it \r\n// was loaded:\r\n- (void)adView:(FBAdView *)adView didFailWithError:(NSError *)error;\r\n{\r\n NSLog(@\"Ad failed to load\");\r\n // Add code to hide the ad unit...\r\n // E.g. adView.hidden = YES;\r\n}\r\n\r\n- (void)adViewDidLoad:(FBAdView *)adView;\r\n{\r\n NSLog(@\"Ad was loaded and ready to be displayed\");\r\n // Add code to show the ad unit...\r\n // E.g. adView.hidden = NO;\r\n}", "updateAuthor": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "created": "2015-05-27T08:41:40.000+0000", "updated": "2015-05-27T08:41:40.000+0000" }, { "id": "353632", "author": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "body": "Facebook iOS Interstitial:\r\n// Import the SDK header file and declare that you are implementing \r\n// the FBInterstitialAdDelegate protocol:\r\n#import \r\n\r\n@interface MyViewController : UIViewController \r\n // Other code might go here...\r\n@end\r\n\r\n// Add a function in your View Controller that initializes the interstitialAd:\r\n- (void)loadInterstitial\r\n{\r\n FBInterstitialAd *interstitialAd =\r\n [[FBInterstitialAd alloc] initWithPlacementID:@\"347360645445128_445223535658838\"];\r\n interstitialAd.delegate = self;\r\n [interstitialAd loadAd];\r\n}\r\n\r\n// Now that you have added the code to load the ad, add the following functions \r\n// to display the ad once it is loaded and to handle loading failures:\r\n- (void)interstitialAdDidLoad:(FBInterstitialAd *)interstitialAd\r\n{\r\n NSLog(@\"Interstitial ad is loaded and ready to be displayed\");\r\n\r\n // You can now display the full screen ad using this code:\r\n [interstitialAd showAdFromRootViewController:self];\r\n}\r\n\r\n- (void)interstitialAd:(FBInterstitialAd *)interstitialAd \r\n didFailWithError:(NSError *)error\r\n{\r\n NSLog(@\"Interstitial ad is failed to load with error: %@\", error);\r\n}", "updateAuthor": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "created": "2015-05-27T08:42:34.000+0000", "updated": "2015-05-27T08:42:34.000+0000" }, { "id": "353633", "author": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "body": "FB iOS Native Placement:\r\n// Import the SDK header file and declare that you are implementing \r\n// the FBNativeAdDelegate protocol:\r\n#import \r\n\r\n@interface MyViewController : UIViewController \r\n // Other code might go here...\r\n@end\r\n\r\n// Add a function in your View Controller that initializes the FBNAtiveAd \r\n// and request an ad to load:\r\n- (void)showNativeAd\r\n{\r\n FBNativeAd *nativeAd = \r\n [[FBNativeAd alloc] initWithPlacementID:@\"347360645445128_445223535658838\"];\r\n nativeAd.delegate = self;\r\n [nativeAd loadAd];\r\n}\r\n\r\n// Now that you have added the code to load the ad, add the following \r\n// functions to handle loading failures and to construct the ad once \r\n// it has loaded:\r\n- (void)nativeAdDidLoad:(FBNativeAd *)nativeAd\r\n{ \r\n NSString *titleForAd = nativeAd.title;\r\n NSString *bodyTextForAd = nativeAd.body;\r\n FBAdImage *coverImage = nativeAd.coverImage;\r\n FBAdImage *iconForAd = nativeAd.icon;\r\n NSString *socialContextForAd = nativeAd.socialContext;\r\n struct FBAdStarRating appRatingForAd = nativeAd.starRating;\r\n NSString *titleForAdButton = nativeAd.callToAction;\r\n\r\n // Add code here to create a custom UIView that uses the ad properties\r\n // For example:\r\n UIView *nativeAdView = [[UIView alloc]initWithFrame:adFrame];\r\n UILabel *titleLabel = [[UILabel alloc] initWithFrame:titleFrame];\r\n titleLabel.text = titleForAd;\r\n [nativeAdView addSubview:titleLabel];\r\n ...\r\n\r\n // Add the ad to the view hirarchy \r\n [self.view addSubview:nativeAdView];\r\n\r\n // Register the native ad view and its view controller with the \r\n // native ad instance\r\n [nativeAd registerViewForInteraction:nativeAdView withViewController:self];\r\n}\r\n\r\n- (void)nativeAd:(FBNativeAd *)nativeAd didFailWithError:(NSError *)error\r\n{\r\n NSLog(@\"Ad failed to load with error: %@\", error);\r\n}", "updateAuthor": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "created": "2015-05-27T08:43:21.000+0000", "updated": "2015-05-27T08:43:21.000+0000" }, { "id": "353634", "author": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "body": "FB Android Banner:\r\n// Edit your activity's layout XML file to include a\r\n// RelativeLayout to contain the AdView:\r\n\r\n\r\n\r\n \r\n\r\n...\r\n\r\n\r\n// In your activity's onCreate function, construct the AdView,\r\n// add to the container view and load the ad:\r\n\r\nprivate AdView adView;\r\n\r\n@Override\r\npublic void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n\r\n ...\r\n RelativeLayout adViewContainer = (RelativeLayout) findViewById(R.id.adViewContainer);\r\n\r\n adView = new AdView(this, \"347360645445128_445223535658838\", AdSize.BANNER_320_50);\r\n adViewContainer.addView(adView);\r\n adView.loadAd();\r\n}", "updateAuthor": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "created": "2015-05-27T08:44:16.000+0000", "updated": "2015-05-27T08:44:16.000+0000" }, { "id": "353635", "author": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "body": "FB Android Interstitial:\r\n// Declare the InterstitialActivity in AndroidManifest.xml:\r\n// \r\n// In the Activity that will launch the interstitial,\r\n// implement the AdListener interface and add the following:\r\n\r\nimport com.facebook.ads.*;\r\n\r\nprivate InterstitialAd interstitialAd;\r\n\r\nprivate void loadInterstitialAd() {\r\n interstitialAd = new InterstitialAd(this, \"347360645445128_445223535658838\");\r\n interstitialAd.setAdListener(this);\r\n interstitialAd.loadAd();\r\n}\r\n\r\n@Override\r\npublic void onError(Ad ad, AdError error) {\r\n // Ad failed to load\r\n}\r\n\r\n@Override\r\npublic void onAdLoaded(Ad ad) {\r\n // Ad is loaded and ready to be displayed\r\n // You can now display the full screen add using this code:\r\n interstitialAd.show();\r\n}", "updateAuthor": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "created": "2015-05-27T08:44:54.000+0000", "updated": "2015-05-27T08:44:54.000+0000" }, { "id": "353636", "author": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "body": "FB Android Native Placement:\r\n// In the Activity that will launch the native ad,\r\n// implement the AdListener interface and add the following:\r\n\r\nimport com.facebook.ads.*;\r\n\r\nprivate NativeAd nativeAd;\r\n\r\nprivate void showNativeAd(){\r\n nativeAd = new NativeAd(this, \"347360645445128_445223535658838\");\r\n nativeAd.setAdListener(new AdListener() {\r\n\r\n @Override\r\n public void onError(Ad ad, AdError error) {\r\n ...\r\n }\r\n\r\n @Override\r\n public void onAdLoaded(Ad ad) {\r\n ...\r\n }\r\n\r\n @Override\r\n public void onAdClicked(Ad ad) {\r\n ...\r\n }\r\n });\r\n\r\n nativeAd.loadAd();\r\n}\r\n\r\n// The next step is to extract the ad metadata and use its properties \r\n// to build your customized native UI. Modify the onAdLoaded function \r\n// above to retrieve the ad properties. For example:\r\n@Override\r\npublic void onAdLoaded(Ad ad) {\r\n if (ad != nativeAd) {\r\n return;\r\n }\r\n\r\n String titleForAd = nativeAd.getAdTitle();\r\n Image coverImage = nativeAd.getAdCoverImage();\r\n Image iconForAd = nativeAd.getAdIcon();\r\n String socialContextForAd = nativeAd.getAdSocialContext();\r\n String titleForAdButton = nativeAd.getAdCallToAction();\r\n String textForAdBody = nativeAd.getAdBody();\r\n Rating appRatingForAd = nativeAd.getAdStarRating();\r\n\r\n // Add code here to create a custom view that uses the ad properties\r\n // For example:\r\n LinearLayout nativeAdContainer = new LinearLayout(this);\r\n TextView titleLabel = new TextView(this);\r\n titleLabel.setText(titleForAd);\r\n nativeAdContainer.addView(titleLabel);\r\n ...\r\n\r\n // Add the ad to your layout\r\n LinearLayout mainContainer = (LinearLayout)findViewById(R.id.MainContainer);\r\n mainContainer.addView(nativeAdContainer);\r\n\r\n // Register the native ad view with the native ad instance\r\n nativeAd.registerViewForInteraction(nativeAdContainer);\r\n}", "updateAuthor": { "name": "safadig", "key": "safadig", "displayName": "Ghassan", "active": true, "timeZone": "America/Havana" }, "created": "2015-05-27T08:45:31.000+0000", "updated": "2015-05-27T08:45:31.000+0000" }, { "id": "428236", "author": { "name": "gfigueras", "key": "gfigueras", "displayName": "Guillermo Figueras", "active": true, "timeZone": "Europe/Madrid" }, "body": "Is there any plan on implementing this?\r\n\r\nIt would be a good thing to have the possibility to include other ad networks besides Admob.", "updateAuthor": { "name": "gfigueras", "key": "gfigueras", "displayName": "Guillermo Figueras", "active": true, "timeZone": "Europe/Madrid" }, "created": "2017-09-21T09:58:40.000+0000", "updated": "2017-09-21T09:58:40.000+0000" }, { "id": "429861", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, we'd like to support this, but when is the real issue. This will have to move to after 7.0.0 SDK, so this will be the first for 7.1.0.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-30T21:48:34.000+0000", "updated": "2017-10-30T21:48:34.000+0000" }, { "id": "433515", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "After checking some general requirements of this effort, I would recommend to *not* making it part of Ti.Facebook - simply because the .framework takes 60+ MB space and will blow up the app size even when not used. Instead, here is a simple implementation for Hyperloop using Cocoapods that does the same thing but only if you need it:\r\n\r\n# Add {{pod 'FBAudienceNetwork'}} to your Podfile\r\n# Import the framework\r\n{code:js}\r\nvar FBInterstitialAd = require('FBAudienceNetwork/FBInterstitialAd');\r\n{code}\r\n# Load the ad (taken as an example from [the official docs|https://developers.facebook.com/docs/audience-network/ios-interstitial])\r\n{code:js}\r\nvar ad = FBInterstitialAd.alloc(). initWithPlacementID('YOUR_PLACEMENT_ID');\r\nad.delegate = yourDelegate;\r\nad.loadAd();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-23T13:58:30.000+0000", "updated": "2018-01-23T13:58:30.000+0000" }, { "id": "439720", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing old \"Won't fix\" tickets. If you disagree, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-02T22:20:02.000+0000", "updated": "2018-08-02T22:20:02.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }