-
Notifications
You must be signed in to change notification settings - Fork 4
Setup HyBid
- Download HyBid.framework and add it to your app. For this:
- Simply drag and drop the HyBid.framework file to Embedded Binaries section on project configuration page.
- Select your target and navigate to the Build Phases. Then, add a Run Script step to your build steps.

- Put it after your step to Embed Frameworks, set it to use
/bin/shand enter the following script:
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
find "$APP_PATH" -name 'HyBid.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
doneTo use the Adapters in your project, simply import PubnativeLite/PubnativeLiteDemo/Adapters file and all of its contents to your project.
To use the Adapters in your Swift project, ensure that you've imported PubnativeLite/PubnativeLiteDemo/Adapters/HyBid-Bridging-Header.h to your project and the Objective-C Bridging Header build setting under Swift Compiler - Code Generation has a path to the header
Add the HyBid.framework to your code.
Swift:
import HyBidObjective-C:
#import <HyBid/HyBid.h>In order to initialize a request, you must call init() before requesting for ads.
Swift:
HyBid.initWithAppToken("<YOUR_APP_TOKEN_HERE>") { (success) in
print("HyBid initialisation completed")
}Objective-C:
[HyBid initWithAppToken:@"<YOUR_APP_TOKEN_HERE>" completion:^(BOOL success) {
NSLog(@"HyBid initialisation completed");
}];There are certain parameters that should be configured in the SDK before doing any type of interaction with it. Ensure to configure these parameters only 1 per session.
Swift:
HyBid.setCoppa(Bool)Objective-C:
[HyBid setCoppa:BOOL];In development, you should set Test Mode as true for our SDK and disable it in the release. It allows not to track impressions and tracks on the server side of development application:
Swift:
HyBid.setTestMode(Bool)Objective-C:
[HyBid setTestMode:BOOL];If you want to improve targeting, first configure the HyBidTargetingModel object that you want to pass on and then invoke the following method:
Swift:
var targeting = HyBidTargetingModel()
targeting.age = <AGE>
targeting.interests = <ARRAY_OF_THE_INTERESTS>
targeting.gender = "<GENDER>" // "f" for female, "m" for male
HyBid.setTargeting(targeting)Objective-C:
HyBidTargetingModel *targeting = [[HyBidTargetingModel alloc] init];
targeting.age = <AGE>;
targeting.interests = <ARRAY_OF_THE_INTERESTS>;
targeting.gender = "<GENDER>"; // "f" for female, "m" for male
[HyBid setTargeting:targeting];