iOS Question Adbuddiz

John Decowski

Member
Licensed User
Longtime User
anyone know how to use adbuddiz sdk on b4i?

I was wondering how I add thier sdk to my project and also how to use inline objective c to load ad. Here's the "2 lines of code" they mention on website:
#import <AdBuddiz/AdBuddiz.h>[AdBuddiz showAd]
Do i simply create folder on my local Mac builder ?
Thanks
 

John Decowski

Member
Licensed User
Longtime User
Here is a copy and paste. Apparently you need to log in to view this:
iOS Objective-C
This is the standard SDK made for developers who can call Objective-C methods.

1. Download SDK
iOS Objective-C SDK 2.4.4: Download

2. Add mandatory frameworks

Drag and drop AdBuddiz.framework into your project.

In Project target / General / Linked Frameworks and Libraries, also add the following system frameworks :

  • SystemConfiguration.framework
  • AdSupport.framework
  • StoreKit.framework
3. Configure SDK
a) Configure SDK
No iOS app added yet! Add an iOS app

b) Optional - Test Mode (show )
c) Optional - Logs (show )

4. Show ad
a) Show Ad
Wherever you want to display an ad, add the following import and SDK call.
We recommend this call be made where there is a natural break in play like between levels for example.

#import <AdBuddiz/AdBuddiz.h>[AdBuddiz showAd];
b) Optional - Delegate (show )
c) Optional - Request SDK Status (show )

Congratulations
The AdBuddiz SDK is now successfully integrated! Once you have displayed your first ad, the SDK status icon of your app should be
sdk-ok.png
.

When submitting to the App Store, please follow our Advertising Identifier (IDFA) guidelines.

Do not publish to the App Store if it's
sdk-unknown.png
or
sdk-noimpression.png
, it means you have a problem. Please troubleshoot with the Tech FAQ.
 
Upvote 0

John Decowski

Member
Licensed User
Longtime User
it also says you can register a delegate:
b) Optional - Delegate (hide )
In order to get more information about the SDK behavior, you can register a delegate.

[AdBuddiz setDelegate:delegate];
The delegate must respond to AdBuddizDelegate protocol:

@protocolAdBuddizDelegate@optional-(void)didCacheAd;// When an Ad has been downloaded and is ready to show-(void)didShowAd;// When an Ad has been displayed to user-(void)didFailToShowAd:(AdBuddizError) error;// When no Ad was displayed -(void)didClick;// When an Ad was clicked-(void)didHideAd;// When an Ad was hidden@end
You can get more details for the AdBuddizError of didFailToShowAd: using:

[AdBuddiz nameForError:error]
Look at the Tech FAQ for explanations about the different AdBuddizError values
 
Upvote 0

John Decowski

Member
Licensed User
Longtime User
i put sdk files in libs folder on local builder.

i wrote this code based on what they said:
B4X:
    #If ObjC
        #import <AVFoundation/AVFoundation.h>
        #import <SystemConfiguration/SystemConfiguration.h>
        #import <AdSupport/AdSupport.h>
        #import <StoreKit/StoreKit.h>
        #import <AdBuddiz/AdBuddiz.h>
        [AdBuddiz showAd];
    #end if

and i get this error response upon build:

B4X:
Parsing code.                           0.00
Compiling code.                         0.02
Compiling layouts code.                 0.02
Compiling debugger engine code.         0.61
Building Xcode project                  0.02
Sending data to remote compiler.        Error
B4i line: 10
Sub Process_Globals
expected identifier or '('
Out: Build settings from command line:
    ARCHS = armv7
    CODE_SIGN_IDENTITY = iPhone
    CONFIGURATION_BUILD_DIR = /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload
    OTHER_CODE_SIGN_FLAGS = --keychain b4i_default
    PRODUCT_NAME = B4i Example
    PROVISIONING_PROFILE = 14f0396d-1bd5-484a-8ecf-a8faeeac8d53

=== BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
/bin/mkdir -p /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7
write-file /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/B4i\ Example.LinkFileList
write-file /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example.hmap
write-file /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-all-non-framework-target-headers.hmap
write-file /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-generated-files.hmap
write-file /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-own-target-headers.hmap
write-file /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-project-headers.hmap
write-file /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-all-target-headers.hmap

Create product structure
/bin/mkdir -p /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload/B4i\ Example.app

ProcessInfoPlistFile Payload/B4i\ Example.app/Info.plist B4iProject/B4iProject-Info.plist
    cd /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-infoPlistUtility /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/B4iProject/B4iProject-Info.plist -genpkginfo /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload/B4i\ Example.app/PkgInfo -expandbuildsettings -format binary -platform iphoneos -o /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload/B4i\ Example.app/Info.plist

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.o B4iProject/b4i_main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-generated-files.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-own-target-headers.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-all-target-headers.hmap -iquote /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-project-headers.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/armv7 -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload -F../../Libs -MMD -MT dependencies -MF /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.d --serialize-diagnostics /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.dia -c /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/B4iProject/b4i_main.m -o /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.o
/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/B4iProject/b4i_main.m:80:3: error: expected identifier or '('
                [AdBuddiz showAd];
                ^
/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/B4iProject/b4i_main.m:80:4: error: missing '[' at start of message send expression
                [AdBuddiz showAd];
                 ^
                 [
/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/B4iProject/b4i_main.m:80:20: error: expected ']'
                [AdBuddiz showAd];
                                 ^
/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/B4iProject/b4i_main.m:80:3: note: to match this '['
                [AdBuddiz showAd];
                ^
3 errors generated.

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/LS_jsontest.o B4iProject/LS_jsontest.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-generated-files.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-own-target-headers.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-all-target-headers.hmap -iquote /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-project-headers.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/armv7 -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload -F../../Libs -MMD -MT dependencies -MF /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/LS_jsontest.d --serialize-diagnostics /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/LS_jsontest.dia -c /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/B4iProject/LS_jsontest.m -o /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/LS_jsontest.o

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.o B4iProject/main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-generated-files.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-own-target-headers.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-all-target-headers.hmap -iquote /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i\ Example-project-headers.hmap -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/armv7 -I/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/Payload -F../../Libs -MMD -MT dependencies -MF /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.d --serialize-diagnostics /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.dia -c /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/B4iProject/main.m -o /Users/John/Desktop/macserver-aa/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.o


Error: ** BUILD FAILED **


The following build commands failed:
    CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.o B4iProject/b4i_main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Currently the only way to add a framework is with a library.

You can modify the xml of one of the existing libraries and add the required frameworks.
For example this screenshot is from iGoogleMaps.xml:

SS-2015-03-09_08.44.59.png


You will need to add the three system frameworks and the third party framework. For the third party framework you need to add .3 to the name (like GoogleMaps.framework in the screenshot).

Your inline code is wrong. Replace it with:
B4X:
Dim no As NativeObject
no.Initialize("AdBuddiz").RunMethod("showAd", null)
 
Upvote 0
Top