提交 5224c3f0 编写于 作者: 杜庆泉's avatar 杜庆泉

基本实现截屏监听,还需要处理细节

上级 6d4de4d4
......@@ -4,12 +4,14 @@
<view class="uni-btn-v uni-common-mt">
<button type="primary" @tap="testGetBatteryCapacity">获取电池电量</button>
<button type="primary" @tap="testGotoDemoActivity">跳转至新的原生页面</button>
<button type="primary" @tap="testScreenShotListen">监听截图事件</button>
</view>
</view>
</template>
<script>
import getBatteryInfo from "@/uni_modules/uni-getbatteryinfo";
import gotoDemoActivity from "@/uni_modules/uts-nativepage";
import {requestPremission,initAppLifecycle} from "@/uni_modules/uts-screenshot-listener";
export default {
data() {
......@@ -30,6 +32,12 @@
}
})
},
testScreenShotListen() {
// 请求写入储存的权限
console.log("111");
requestPremission();
initAppLifecycle();
},
testGotoDemoActivity() {
gotoDemoActivity();
......
......@@ -5,7 +5,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application>
<service android:name="uts.sdk.modules.utsNativepage.ForeService" />
<service android:name="uts.sdk.modules.utsNativepage.ForeService" />
<activity android:name="uts.sdk.modules.utsNativepage.DemoActivity"></activity>
</application>
</manifest>
......@@ -24,7 +24,7 @@ import {
import Service from 'android.app.Service';
import System from 'java.lang.System';
import WindowManager from 'android.view.WindowManager';
class ForeService extends Service {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册