Skip to content

williamrijksen/ti.optimizationpreferences

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ti.optimizationpreferences Build Status

This project is to handle protected apps in huawei devices and to prevent your app being killed by the Samsung Smartmanager.

Inspired by:

Follow Guide

Setup

  1. Download the latest version of the module at releases.

  2. Integrate the module into the modules folder and define them into the tiapp.xml file:

    <modules>
      <module platform="android" version="1.1.0">ti.optimizationpreferences</module>
    </modules>

Usage

  1. Show the warning and give the end-user the possiblility to add the app to protected apps

    if (!OS_ANDROID) {
         return;
     }
    
     var optimizationpreferences = require('ti.optimizationpreferences'),
     	 brands = [optimizationpreferences.HUAWEI, optimizationpreferences.SAMSUNG];
    
     // need warning checks the huawei/samsung activities exists
     if (optimizationpreferences.needWarning(brands)) {
         optimizationpreferences.check(brands);
     }