로딩중입니다
AdPOPcorn Plus Lock: Android + Unity Android
4/12/2016 8:05:44 PM

adPOPcorn Plus Lock

adPOPcorn Plus Lock is an additional OfferWall feature that offers monetization by showing an ad on a lock screen.

To use Plus Lock, OfferWall must be integrated and follow the below guide for additional integration.


Note
  1. OfferWall must be integrated before integrating Plus Lock Add on.
    [adPOPcorn OfferWall: Android] & [adPOPcorn OfferWall: Unity Android]
  2. To integrate adPOPcorn IgawPlusLock~*.jar file must be included in an Android project.
    [Install SDK: Android] & [Install SDK : Unity]
  3. Plus Lock is available for IgawAdpopcorn ver. 4.0 or above.



AndroidManifest.xml

To integrate Plus Lock, edit AndroidManifest.xml file.


Add Permission

In <manifest></manifest>, add required permissions. It won't work if these permissions are not included.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.GET_ACCOUNT"/>


In <manifest></manifest>, add permissions. Below permission is optional. Automatic video download in Wi-Fi feature will be activated after adding the permission. (If you don't add permission, this feature will not be activated.)

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Add LargeHeap Option

In <application>, Add LargeHeap option as shown below. This is to show several images seamlessly on the lock screen.

<application
	{ omit }
	android:largeHeap="true">


Add Activity

In <application></application>, add Activity.

<activity android:name="com.igaworks.adpopcorn.pluslock.activity.PlusLockActivity"
    android:theme="@android:style/Theme.NoTitleBar"
    android:screenOrientation="portrait"
    android:configChanges="orientation|screenSize"
    android:excludeFromRecents="true" />
			
<activity android:name="com.igaworks.adpopcorn.pluslock.activity.PlusLockRewardAdActivity"
    android:theme="@android:style/Theme.NoTitleBar"
    android:screenOrientation="landscape"
    android:excludeFromRecents="true" />


Add Plus Lock Service

In <application></application>, Add Plus Lock Service.

<service  android:label="PlusLock" android:name="com.igaworks.adpopcorn.pluslock.IgawPlusLockService"
        android:process="com.igaworks.pluslock">
</service>



Add Plus Lock Receiver

In <application></application>, add Plus Lock Receiver.
<receiver android:name="com.igaworks.adpopcorn.pluslock.IgawPlusLockReceiver">
	<intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
         </intent-filter>
         <intent-filter>
                <action android:name="android.intent.action.PACKAGE_ADDED"/>
                <action android:name="android.intent.action.PACKAGE_REPLACED"/>
                <data android:scheme="package" />
         </intent-filter>
         <intent-filter>
                <action android:name="android.intent.action.USER_PRESENT" />
         </intent-filter>
</receiver>
Note!!!
Information above is only for setting up Plus Lock SDK.
If you are setting this without SDK, the app might crash or cause other problem.


PlusLock Logout API 

Add below API in case that user information is changed within the app or log-out.
API> public static void logout(Context context);
Example> IgawPlusLock.logout(context); 
Note!!!
In case that user information is changed within the app or log-out, Point will not be given because of existing user information.
Therefore, this should be added. 


Activate Plus Lock

Activating Plus Lock is included in adPOPcorn OfferWall. Therefore, you have to complete [adPOPcorn OfferWall: Android] integration first.

After completing  Android Manifest setting for OfferWall and Plus Lock, you'll see the following setting,

And when you turn on, Plus Lock lock screen gets activated.

    



Custom API: Android

Offers custom API for Plus Lock Event and Action.

Custom API is available for IgawPlusLock_v1.0.1 and above.


1. Plus Lock Status Check

Using IsActivateLockScreen API, you can check on/off status of Plus Lock.

With this API, if Plus Lock is off, you can encourage users to turn it on or use different actions.

bool isActivePlusLockScreen = IgawPlusLock.IsActiveLockScreen(MainActivity.this);
// isActivePlusLockScreen : 
//     true : Screen ON
//     false : Screen OFF



2. Plus Lock Manual ON/OFF 

Using activateLockScreen API, you can on/off Plus Lock using code.

In addition, result of processing will return through IPlusLockResultCallback listener. Using this, you can easily enable and disable Plus Lock service.

    [Example]


      Note!!!
      setUserId API must be called up before ON/OFF API is manually called up. 
      If not, campaign participation will not be allowed. 

      1. Enable Plus Lock (OFF ->ON)
      IgawPlusLock.activateLockScreen(MainActivity.this, true, iplusLockResultCallback);
      2. PlusLock Authorization Setting
      OnRequestPermissionResult API should be called up to check if user autorize the app in higher than Android 6.0 version.
      @Override
        public void onRequestPermisssionsResult (int requestCode, String[] permissions, int[] grantResult){
        // TODO AUTO-generated method stub
        IgawPlusLock.onRequestPermissionResult(requestCode,permission,grantResult);
       } 
      3. Disable Plus Lock (ON -> OFF)
      IgawPlusLock.activateLockScreen(MainActivity.this, false, iplusLockResultCallback);
      4. Process IPlusLockResultCallback Listener

      Depending on ON or OFF, you have to make sure the request processes and shows up as the result.

      IgawPlusLock.activateLockScreen(context, activate, new IPlusLockResultCallback(){
      @Override
      	public void onResult(ResultModel rm) {
      	// TODO Auto-generated method stub					
      		if(rm != null && rm.isResult()){ //If reponse is ture, proccess the result
      			if(activate) // Start service if "On" requrest is success.	
      				IgawPlusLock.startLockScreenService(context);				
      			else // Close service in "OFF" request is success.	
      				IgawPlusLock.stopLockScreenService(context);				
      		}
      			else{ // Send out message if request is failed.
      				if(activate)
      					Log.d("Failed to start Pluslock. Please try it again later.");	
      				else
      					Log.d("Failed to unlock PlusLock. Please try it again later.");	
      		}		
          }
      });
      


      3. View Plus Lock Point

      Using getPlusLockSaveHistory API, you can view points rewarded through Plus Lock unlock process. 

      It delivers through IPlusLockRewardHistoryCallback, check RewardHistoryModel for the result.

      IgawPlusLock.getPlusLockSavedHistory(context, new IPlusLockRewardHistoryCallback(){
      @Override
      	public void onResult(RewardHistoryModel historyModel) {
      		// TODO Auto-generated method stub
      		if(historyModel != null){
      			if(historyModel.getPoint() != null)
      				pointTv.setText(historyModel.getPoint() + "");
      			}			
      		}				
      	}
      );
      

      4. In-house Push Icon

      In case of adding in-house push, you can edit push setting.

      • setSmallIconResId : Change push icon
      • setSmallIconBgColor : Change push icon background
      IgawPlusLockNotificationManager.setSmallIconResId(context, R.drawable.icon);
      IgawPlusLockNotificationManager.setSmallIconBgColor(context, 0xff123456);


      5. Reward Giving Completion Callback Listener

      This API sends callback after user receive points via reward giving advertising such as Unlock screen, App Installation and Video.

      IgawPlusLock.setRewardInfoCallbackListener(context, new IPlusLockRewardInfoCallback(){
          @Override
          public void OnChanged() {
              // TODO Auto-generated method stub
          }
      });
      

      6. Android Unlock Screen API

      Android default Lock Screen could be unlocked when Plus Lock is unlocked.

      • true : Unlock Android default Lock Screen with Plus Lock
      • false : Unlock PlusLock only (default)
      // ex_ When Plus Lock is unlocked, unlock the Android default Lock Screen.
      IgawPlusLock.setFlagDismissKeyguard(context, true);


      7. Exist User Logout API

      Initialize user information when user log out or change the user information.

      // IgawPlusLock.logout(Context context);
      IgawPlusLock.logout(MainActivity.this);


      8. Lock Screen Type Change API

      PlusLock provide 4 types of Lock Screen. [Sample ScreenShot Download]

      Code TypeComment
      FULLSCREEN_NAVIGATION_TYPENavigator horizontal scroll unlock type (Full Screen, Default)
      NAVIGATION_TYPE
      Navigator horizontal scroll unlock type
      CONTENTS_SLIDE_TYPE
      Content horizontal scroll unlock type
      FULLSCREEN_CONTENTS_SLIDE_TYPE
      Content horizontal scroll unlock type (Full Screen)

      Change the Lock Screen type with below API.

      //IgawPlusLock.setLockScreenType(Context context, int type)
      IgawPlusLock.setLockScreenType(MainActivity.this, IgawPlusLock.LockScreenType.FULLSCREEN_CONTENTS_SLIDE_TYPE);



      Reward Server Integration and QA

      The basic integration for showing an ad using Plus Lock is complete.

      Now you need to enable the reward server integration to give the reward to customers with 100% reward points.

      Reward Server Integration is essential for OfferWall ads and reward so follow the guide below to integrate.

      [IGAW Reward Server Integration Guide]


      After completing the reward server integration and testing ads and reward system, you can request for QA.

      To use adPOPcorn OfferWall service, you must go through QA. Using adPOPcorn Management page's 'Request QA,' send the app file and will take about 1 to 2 days to get result.

      QA Inquiry : QA@igaworks.com