AdSense adLayout parameter not working - ios

I'm using Google-Mobile-Ads-SDK (7.8.1) to load some ads like this:
let bannerView = GADSearchBannerView(adSize:kGADAdSizeFluid)
bannerView.adUnitID = "pub-Super-Secret"
bannerView.frame = CGRectMake(0,0,CGRectGetWidth(self.advertismentContainer.bounds),0)
bannerView.autoresizingMask = .FlexibleWidth
bannerView.delegate = self
bannerView.adSizeDelegate = self
self.advertismentContainer.addSubview(bannerView)
let request = GADDynamicHeightSearchRequest()
request.query = searchTerm
request.numberOfAds = 3
request.adTestEnabled = true
request.clickToCallExtensionEnabled = true
request.setAdvancedOptionValue("false", forKey:"domainLinkAboveDescription")
request.setAdvancedOptionValue("false", forKey:"sellerRatings")
request.setAdvancedOptionValue("false", forKey:"siteLinks")
request.setAdvancedOptionValue("sellerFirst", forKey:"adLayout")
bannerView.loadRequest(request)
I'm refering to the official documentation to find what parameters I can send. Sure enough, there is adLayout parameter, which is exactly what I need:
By default, adLayout is disabled. If you wish to enable it, use this
line of code:
'adLayout' : 'sellerFirst'
Unfortunately, it comes with a star, but the star is never explained in the document I linked. I have tried to use the sellerFirst layout, but it doesn't work. Is it possible to use this parameter in the iOS SDK? The ads load fine but the adLayout parameter has no effect.

Turns out that there are 2 problems:
adLayout parameter needs to be enabled for the specific client-id, so if you want to use it you need to contact Google and ask them to enable it for you.
at the moment, this parameter is only available for the web clients, I was told that on iOS and Android it's still work in progress.

Related

How to localize the Autodesk Forge Viewer DiffTool extension

We are using the Autodesk Forge Viewer DiffTool extension, but we need to change one of the texts:
Every tutorial shows how add localization to your own extension, but I couldn't find how to change a translation in an existing extension you are using.
Moreover, without knowing what the translation key is, I would have "guess" it, which isn't really great either.
So, how do I change the translation for this text?
There is no supported way to hook into the translation service of the Viewer to change the text. If the translation is wrong, please let us know, and we can fix that on our side.
If you want to change the text for some other reasons, then one thing you could do is wait for the initialization of the extension's UI and change the button's content using DOM APIs:
let extensionConfig = {}
extensionConfig['mimeType'] = 'application/vnd.autodesk.revit'
extensionConfig['primaryModels'] = [model1]
extensionConfig['diffModels'] = [model2]
extensionConfig['diffMode'] = 'overlay'
extensionConfig['versionA'] = '2'
extensionConfig['versionB'] = '1'
extensionConfig['onInitialized'] = () => {
let button = document.getElementById("diffFacetsRemovedButton");
let label = button.nextSibling;
label.innerHTML = label.innerHTML.replace("Odebrat", "Něco jiného");
}
viewer.loadExtension('Autodesk.DiffTool', extensionConfig);

Setting a device target on google ads API

I'm trying to create a campaign that must target mobile devices only, using the google ads API client library in python. The documentation says that I have to modify the DeviceInfo criteria, but that attribute is immutable.
This is my code rn:
campaign_service = client.get_service("CampaignService")
campaign_criterion_service = client.get_service("CampaignCriterionService")
# Create the campaign criterion.
campaign_criterion_operation = client.get_type("CampaignCriterionOperation")
campaign_criterion = campaign_criterion_operation.create
campaign_criterion.campaign = campaign_service.campaign_path(
customer_id, campaign_id
)
campaign_criterion.device = client.enums.DeviceEnum.MOBILE
What am I missing?
For most of Enums you have to use the .type_ after the value you wanna set.
So you should use:
campaign_criterion.device.type_ = client.enums.DeviceEnum.MOBILE
A nice advice is to download library code and goes into reading that.

How can I find the default value of a property that is part of an Apple framework?

I made a VNRecognizeTextRequest which is part of the Apple's Vision framework.
let request = VNRecognizeTextRequest()
request.customWords = ["Weird word"]
The description of customWords says that it will be ignored if "language correction is disabled."
I assume they are talking about usesLanguageCorrection.
let request = VNRecognizeTextRequest()
request.customWords = ["Weird word"]
request.usesLanguageCorrection = true /// here
I could just set it to true myself. However, I want to know the default value of this -- whether it will be true or false if I don't set it myself.
I could just print it out, but it would be nice if there was something like Jump to Definition:

Link encryption?

I have been stuck on a problem for a few hours. Nothing online has helped and I'm losing the will to live right now.
The site loads up a question with no hints and asks you to find a secret code.
Here's the brief explanation of it:
'Well done on making it to the secret bonus challenge! Our agents have been struggling to deal with a hacker obsessed with clocks and timing. He set up an elaborate collection of pages with content that changes based on a timer. We've replicated it below, can you figure out how to get the secret code?'
There are many links inside this challenge and when they are clicked it opens to a new website and has pseudo strings in there, I don't see much pattern. Links below:
https://assess.joincyberdiscovery.com/challenge-files/clock-pt1?verify=BY%2F8lhw%2BtbBgvOMDiHeB5A%3D%3D
https://assess.joincyberdiscovery.com/challenge-files/clock-pt2?verify=BY%2F8lhw%2BtbBgvOMDiHeB5A%3D%3D
https://assess.joincyberdiscovery.com/challenge-files/clock-pt3?
verify=BY%2F8lhw%2BtbBgvOMDiHeB5A%3D%3D
https://assess.joincyberdiscovery.com/challenge-files/clock-pt4?
verify=BY%2F8lhw%2BtbBgvOMDiHeB5A%3D%3D
https://assess.joincyberdiscovery.com/challenge-files/clock-pt5?verify=BY%2F8lhw%2BtbBgvOMDiHeB5A%3D%3D
(If it doesn't allow you to go on) then what it has is just a tag and no element with what it seems a three character code which always ends in 'a' for example 'Aja' and makes a new one every 10 seconds (which is not re-generated client side.)
Anyone have any suggestions to whether or not the link is a hint of encryption or not? I've decrypted it once and it came up with:
'https://assess.joincyberdiscovery.com/challenge-files/clock-pt5?verify=BY/8lhw tbBgvOMDiHeB5A==' which isn't much help.
Anyways, anyone have any suggestions?
Thanks :)
Its not impossible. I have the answer here:
import requests
page1 = "https://assess.joincyberdiscovery.com/challenge-files/clock-pt1?verify=wMHfxKSix2qSPJtLe6U98w%3D%3D"
page1_content = requests.get(page1)
page1txt = page1_content.text
page2 = "https://assess.joincyberdiscovery.com/challenge-files/clock-pt2?verify=wMHfxKSix2qSPJtLe6U98w%3D%3D"
page2_content = requests.get(page2)
page2txt = page2_content.text
page3 = "https://assess.joincyberdiscovery.com/challenge-files/clock-pt3?verify=wMHfxKSix2qSPJtLe6U98w%3D%3D"
page3_content = requests.get(page3)
page3txt = page3_content.text
page4 = "https://assess.joincyberdiscovery.com/challenge-files/clock-pt4?verify=wMHfxKSix2qSPJtLe6U98w%3D%3D"
page4_content = requests.get(page4)
page4txt = page4_content.text
page5 = "https://assess.joincyberdiscovery.com/challenge-files/clock-pt5?verify=wMHfxKSix2qSPJtLe6U98w%3D%3D"
page5_content = requests.get(page5)
page5txt = page5_content.text
code = (page1txt + page2txt + page3txt + page4txt + page5txt)
page6 = "https://assess.joincyberdiscovery.com/challenge-files/get-flag?verify=wMHfxKSix2qSPJtLe6U98w%3D%3D&string="+code
page6txt = requests.get(page6)
print (page6txt.text)
Replace all of the links with the links you are given

How to add cordova AppRate plugin to Intel XDK?

I have added the plugin but cannot to setup config file(intelxdk.config.additions.xml).
If I add this code to config:
var customLocale = {}
customLocale.title = "Rate %#";
customLocale.message = "If you enjoy using %#, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!";
customLocale.cancelButtonLabel = "No, Thanks";
customLocale.laterButtonLabel = "Remind Me Later";
customLocale.rateButtonLabel = "Rate It Now";
AppRate.preferences.openStoreInApp = true;
AppRate.preferences.storeAppURL.android = 'market://details?id=com.site.test';
AppRate.preferences.customLocale = customLocale;
AppRate.preferences.displayAppName = 'My custom app title';
AppRate.preferences.usesUntilPrompt = 1;
AppRate.preferences.promptAgainForEachNewVersion = false;
AppRate.promptForRating(true);
nothing happing when I test my app on real device.
First off, go to the project tab.
Go in plugins->
Third party plugins.
Click on Get Plugin from the web.
For the name, write AppRate or anything you whant. For the plugin Id, write org.pushandplay.cordova.apprate and check "Plugin is located in the Apache Cordova plugins Registry".
BE WARNED that any third plugins can only be tested on the build tab.
After all that it should work.
P.S, there is nothing to add in the additions.xml file to make it work. Just put your code in a function that you call and it should work like a charm

Resources