Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
iAd and in-app purchases
-
Is it possible to add iAd banners and in-app purchases to app developed in Pythonista?
-
https://forum.omz-software.com/topic/1109/need-help-with-ads
Does the addition of objc_util make this possible?
-
@ccc said:
https://forum.omz-software.com/topic/1109/need-help-with-ads
Well, all iAd classes are included in iAd.framework, not the Objective C standard library. Because I tried to run
ADBanner = objc_util.ObjCClass('ADBannerView')
And got an error
"no Objective-C class named 'b'ADBannerView'' found"
So is there any ways to use this framework classes? Or my problem is in something else?
(In fact I'm new to objc_util and Objective C at all, so excuse me if I'm asking for something evident or doing silly things)) -
@krizex Pythonista itself doesn't use the iAd framework, so you'd have to load it first:
objc_util.load_framework('iAd')
I think this function is undocumented, it's equivalent to:
objc_util.ObjCClass('NSBundle').bundleWithPath_('/System/Frameworks/iAd.framework').load()
-
@omz thank you for feedback, it works now. So, can I integrate this into Scene somehow?
-
Anybody? I think this will be quite useful for developers using pythonista to know, how to use these utilities in their apps, because this is the most used way of making money on apps. I'm not so good in objective-C and pythonista, so any ideas anybody (how to use created ObjCClass of ADBannerView in Scene and how to add in-app purchases)?
-
from what I gather, you won't be able to test this in pythonista, since the app was not deployed with iAd, or omz is nit a member of iAds. I tried creating an ADBannerView and adding to a ui.View, and the banner never loaded.
-
ADBannerView
is now deprecated. https://developer.apple.com/reference/iadWikipedia says the iAd network shutdown in June 2016 https://en.m.wikipedia.org/wiki/IAd in this Apple announcement https://developer.apple.com/support/iad