Skip to content

Instantly share code, notes, and snippets.

@flurrydev
flurrydev / gist:66cc710154722cbe5b52bafe18068153
Created October 30, 2018 18:52
Swift sample native ads
var nativeAd = FlurryAdNative(space:"staticAds")
var nativeAds: [FlurryAdNative] = []
override func viewDidLoad() {
super.viewDidLoad();
for _ in 1...5 {
nativeAd?.adDelegate = self;
nativeAd?.viewControllerForPresentation = self;
public class DeeplinkTestActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// get the data from the intent.
<activity
android:name=".DeeplinkTestActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
private void initializeFlurry() {
...
// pass Flurry the default icon id, and background color
int notificationIcon = getNotificationIcon();
FlurryMarketingOptions flurryMarketingOptions = new FlurryMarketingOptions.Builder()
new FlurryAgent.Builder()
...
.withModule(marketingModule)
.withIncludeBackgroundSessionsInMetrics(false)
...
// define channel attributes (name, description, and id)
public static final String NOTIFICATION_CHANNEL_ID = "SomeChannelId"
public static final String NOTIFICATION_CHANNEL_NAME = "UserFacingChannelName"
public static final String NOTIFICATION_CHANNEL_DESCRIPTION = "User facing description of the channel"
// create notification channel
compile ‘com.google.firebase:firebase-core:X.Y.Z’
compile ‘com.google.firebase:firebase-messaging:X.Y.Z’
//replace X.Y.Z with the latest version of the Flurry SDK version
compile “com.flurry.android:marketing:X.Y.Z@aar”
// required to use flurry marketing
compile “com.flurry.android:analytics:X.Y.Z@aar”
/\*
\* This method will only be called whenever a Flurry notification is received, regardless of
\* whether app is in foreground or in background. To determine app
\* state, you can either track it yourself or call FlurryMessaging.isAppInForeground
\*/