-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Buzzvil/buzz-sdk-samples
# Conflicts: # README_EN.md # README_UNITY.md # buzzad-offerwall/README_EN.md # buzzad-offerwall/README_UNITY.md # buzzad-offerwall/build.gradle # buzzad-offerwall/buzzad-sample/build.gradle # buzzad-offerwall/buzzad-sample/proguard-project.txt # buzzad-offerwall/buzzad-sample/project.properties # buzzad-offerwall/buzzad-sample/src/main/AndroidManifest.xml # buzzad-offerwall/buzzad-sample/src/main/java/com/buzzvil/buzzad/sample/MainActivity.java # buzzad-offerwall/buzzad-sample/src/main/java/com/buzzvil/buzzad/sample/OfferActivity.java # buzzad-offerwall/buzzad-sample/src/main/res/drawable-hdpi/ic_launcher.png # buzzad-offerwall/buzzad-sample/src/main/res/drawable-mdpi/ic_launcher.png # buzzad-offerwall/buzzad-sample/src/main/res/drawable-xhdpi/ic_launcher.png # buzzad-offerwall/buzzad-sample/src/main/res/layout/activity_main.xml # buzzad-offerwall/buzzad-sample/src/main/res/layout/activity_offer.xml # buzzad-offerwall/buzzad-sample/src/main/res/values/strings.xml # buzzad-offerwall/buzzad-sample/src/main/res/values/styles.xml # buzzad-offerwall/buzzad-unity-sdk/BuzzAdUnityPlugin-1.0.1.unitypackage # buzzad-offerwall/gradle/wrapper/gradle-wrapper.jar # buzzad-offerwall/gradle/wrapper/gradle-wrapper.properties # buzzad-offerwall/gradlew # buzzad-offerwall/gradlew.bat # buzzad-offerwall/settings.gradle # buzzad-offerwall/unitypackage_structure.png # buzzad-sample/build.gradle # buzzad-sample/proguard-project.txt # buzzad-sample/project.properties # buzzad-sample/src/main/AndroidManifest.xml # buzzad-sample/src/main/java/com/buzzvil/buzzad/sample/MainActivity.java # buzzad-sample/src/main/java/com/buzzvil/buzzad/sample/OfferActivity.java # buzzad-sample/src/main/res/drawable-hdpi/ic_launcher.png # buzzad-sample/src/main/res/drawable-mdpi/ic_launcher.png # buzzad-sample/src/main/res/drawable-xhdpi/ic_launcher.png # buzzad-sample/src/main/res/layout/activity_main.xml # buzzad-sample/src/main/res/layout/activity_offer.xml # buzzad-sample/src/main/res/values/strings.xml # buzzad-sample/src/main/res/values/styles.xml # buzzad-sdk-publisher/README_EN.md # buzzad-sdk-publisher/README_UNITY.md # buzzad-sdk-publisher/buzzad-sample/build.gradle # buzzad-sdk-publisher/buzzad-sample/proguard-project.txt # buzzad-sdk-publisher/buzzad-sample/project.properties # buzzad-sdk-publisher/buzzad-sample/src/main/AndroidManifest.xml # buzzad-sdk-publisher/buzzad-sample/src/main/java/com/buzzvil/buzzad/sample/MainActivity.java # buzzad-sdk-publisher/buzzad-sample/src/main/java/com/buzzvil/buzzad/sample/OfferActivity.java # buzzad-sdk-publisher/buzzad-sample/src/main/res/drawable-hdpi/ic_launcher.png # buzzad-sdk-publisher/buzzad-sample/src/main/res/drawable-mdpi/ic_launcher.png # buzzad-sdk-publisher/buzzad-sample/src/main/res/drawable-xhdpi/ic_launcher.png # buzzad-sdk-publisher/buzzad-sample/src/main/res/layout/activity_main.xml # buzzad-sdk-publisher/buzzad-sample/src/main/res/layout/activity_offer.xml # buzzad-sdk-publisher/buzzad-sample/src/main/res/values/strings.xml # buzzad-sdk-publisher/buzzad-sample/src/main/res/values/styles.xml # buzzad-sdk-publisher/buzzad-unity-sdk/BuzzAdUnityPlugin-1.0.1.unitypackage # buzzad-sdk-publisher/unitypackage_structure.png # buzzad-unity-sdk/BuzzAdUnityPlugin-1.0.1.unitypackage # unitypackage_structure.png
- Loading branch information
Showing
312 changed files
with
36,440 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# notiplus-sample-publisher | ||
[버즈빌 개발 가이드 문서](https://buzzvil.atlassian.net/wiki/spaces/DEV/pages/508362869/BuzzAdNotiPlus)를 확인해주세요. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 29 | ||
buildToolsVersion "29.0.0" | ||
defaultConfig { | ||
applicationId "com.buzzvil.buzzad.benefit.notiplussample" | ||
minSdkVersion 15 | ||
targetSdkVersion 29 | ||
versionCode 1 | ||
versionName "1.0" | ||
multiDexEnabled true | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation 'androidx.appcompat:appcompat:1.1.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | ||
// BuzzAdBenefit | ||
implementation "com.buzzvil:buzzad-benefit-notification:1.6.9-rc1" | ||
implementation 'com.android.support:multidex:1.0.3' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.1' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
27 changes: 27 additions & 0 deletions
27
...c/androidTest/java/com/buzzvil/buzzad/benefit/notiplussample/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.buzzvil.buzzad.benefit.notiplussample; | ||
|
||
import android.content.Context; | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry; | ||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); | ||
|
||
assertEquals("com.buzzvil.buzzad.benefit.notiplussample", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.buzzvil.buzzad.benefit.notiplussample"> | ||
|
||
<application | ||
android:name=".App" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<receiver | ||
android:name=".RestartReceiver" | ||
android:exported="false"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.BOOT_COMPLETED" /> | ||
</intent-filter> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> | ||
</intent-filter> | ||
</receiver> | ||
</application> | ||
|
||
</manifest> |
50 changes: 50 additions & 0 deletions
50
buzzad-benefit-notiplus/app/src/main/java/com/buzzvil/buzzad/benefit/notiplussample/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.buzzvil.buzzad.benefit.notiplussample; | ||
|
||
import androidx.multidex.MultiDexApplication; | ||
|
||
import com.buzzvil.buzzad.benefit.BuzzAdBenefit; | ||
import com.buzzvil.buzzad.benefit.BuzzAdBenefitConfig; | ||
import com.buzzvil.buzzad.benefit.core.models.UserProfile; | ||
import com.buzzvil.buzzad.benefit.presentation.notification.NotiPlusDialogConfig; | ||
import com.buzzvil.buzzad.benefit.presentation.notification.RewardNotificationConfig; | ||
|
||
public class App extends MultiDexApplication { | ||
public static final String APP_ID = "APP_ID"; | ||
public static final String UNIT_ID_NOTI_PLUS = "UNIT_ID_NOTI_PLUS"; | ||
public static RewardNotificationConfig rewardNotificationConfig; | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
initBuzzAdBenefit(); | ||
} | ||
|
||
private void initBuzzAdBenefit() { | ||
BuzzAdBenefitConfig buzzAdBenefitConfig = new BuzzAdBenefitConfig.Builder(APP_ID) | ||
.build(); | ||
BuzzAdBenefit.init(this, buzzAdBenefitConfig); | ||
|
||
UserProfile userProfile = new UserProfile.Builder(BuzzAdBenefit.getUserProfile()) | ||
.userId("SAMPLE_USER_ID") | ||
.gender(UserProfile.Gender.FEMALE) | ||
.birthYear(1993) | ||
.build(); | ||
BuzzAdBenefit.setUserProfile(userProfile); | ||
} | ||
|
||
public static NotiPlusDialogConfig getNotiPlusDialogConfig() { | ||
return new NotiPlusDialogConfig.Builder() | ||
.colorConfirm(R.color.colorAccent) | ||
.colorCancel(R.color.colorPrimary) | ||
.imageRegisterLogo(R.drawable.benefit_notiplus_dialog_image_logo) | ||
.imageUnregisterLogo(R.drawable.benefit_notiplus_dialog_image_logo) | ||
.build(); | ||
} | ||
|
||
public static RewardNotificationConfig getRewardNotificationConfig() { | ||
if (rewardNotificationConfig == null) { | ||
rewardNotificationConfig = new RewardNotificationConfig.Builder().build(); | ||
} | ||
return rewardNotificationConfig; | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...lus/app/src/main/java/com/buzzvil/buzzad/benefit/notiplussample/CustomFeedAdsAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.buzzvil.buzzad.benefit.notiplussample; | ||
|
||
import android.view.ViewGroup; | ||
import android.widget.Toast; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.buzzvil.buzzad.benefit.presentation.feed.ad.DefaultAdsAdapter; | ||
import com.buzzvil.buzzad.benefit.presentation.nativead.NativeAd; | ||
import com.buzzvil.buzzad.benefit.presentation.nativead.NativeAdRewardResult; | ||
import com.buzzvil.buzzad.benefit.presentation.nativead.NativeAdView; | ||
import com.buzzvil.buzzad.benefit.presentation.notification.BuzzAdNotiPlus; | ||
|
||
public class CustomFeedAdsAdapter extends DefaultAdsAdapter { | ||
|
||
private final NativeAdView.OnNativeAdEventListener listener = new NativeAdView.OnNativeAdEventListener() { | ||
@Override | ||
public void onImpressed(final @NonNull NativeAdView view, final @NonNull NativeAd nativeAd) { | ||
Toast.makeText(view.getContext(), "onImpressed", Toast.LENGTH_SHORT).show(); | ||
} | ||
|
||
@Override | ||
public void onClicked(@NonNull NativeAdView view, @NonNull NativeAd nativeAd) { | ||
Toast.makeText(view.getContext(), "onClicked", Toast.LENGTH_SHORT).show(); | ||
} | ||
|
||
@Override | ||
public void onRewardRequested(@NonNull NativeAdView view, @NonNull NativeAd nativeAd) { | ||
Toast.makeText(view.getContext(), "onRewardRequested", Toast.LENGTH_SHORT).show(); | ||
} | ||
|
||
@Override | ||
public void onRewarded(@NonNull NativeAdView view, @NonNull NativeAd nativeAd, @Nullable NativeAdRewardResult nativeAdRewardResult) { | ||
Toast.makeText(view.getContext(), "onRewarded: " + nativeAdRewardResult, Toast.LENGTH_SHORT).show(); | ||
if (nativeAdRewardResult == NativeAdRewardResult.SUCCESS) { | ||
BuzzAdNotiPlus.showRewardNotification(view.getContext(), App.getRewardNotificationConfig(), nativeAd.getAd().getReward()); | ||
} | ||
} | ||
|
||
@Override | ||
public void onParticipated(final @NonNull NativeAdView view, final @NonNull NativeAd nativeAd) { | ||
Toast.makeText(view.getContext(), "onParticipated", Toast.LENGTH_SHORT).show(); | ||
} | ||
}; | ||
|
||
@Override | ||
public void onBindViewHolder(NativeAdViewHolder holder, NativeAd nativeAd) { | ||
super.onBindViewHolder(holder, nativeAd); | ||
final NativeAdView view = (NativeAdView) holder.itemView; | ||
view.addOnNativeAdEventListener(listener); | ||
} | ||
|
||
@Override | ||
public NativeAdViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
return super.onCreateViewHolder(parent, viewType); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...app/src/main/java/com/buzzvil/buzzad/benefit/notiplussample/CustomNotificationWorker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.buzzvil.buzzad.benefit.notiplussample; | ||
|
||
import android.content.Context; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.work.WorkerParameters; | ||
|
||
import com.buzzvil.buzzad.benefit.presentation.feed.FeedActivity; | ||
import com.buzzvil.buzzad.benefit.presentation.feed.FeedConfig; | ||
import com.buzzvil.buzzad.benefit.presentation.notification.NotiPlusCtaActivity; | ||
import com.buzzvil.buzzad.benefit.presentation.notification.NotificationConfig; | ||
import com.buzzvil.buzzad.benefit.presentation.notification.NotificationWorker; | ||
|
||
public class CustomNotificationWorker extends NotificationWorker { | ||
public CustomNotificationWorker(@NonNull Context context, | ||
@NonNull WorkerParameters workerParams) { | ||
super(context, workerParams); | ||
} | ||
|
||
@Override | ||
@NonNull | ||
public NotificationConfig getNotificationConfig() { | ||
final FeedConfig feedConfig = new FeedConfig.Builder(App.UNIT_ID_NOTI_PLUS) | ||
.adsAdapterClass(CustomFeedAdsAdapter.class) | ||
.build(); | ||
return new NotificationConfig.Builder(App.UNIT_ID_NOTI_PLUS) | ||
.putExtra(FeedActivity.EXTRA_CONFIG, feedConfig) | ||
.putExtra(NotiPlusCtaActivity.EXTRA_REWARD_NOTIFICATION_CONFIG, | ||
App.getRewardNotificationConfig()) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.