junny_dev_kit 0.1.0-dev.20 junny_dev_kit: ^0.1.0-dev.20 copied to clipboard
JunnySoft开发工具包.
JunnySoft Dev Kit #
公共开发工具
Getting Started #
dependencies:
junny_dev_kit: ^latest_version // 替换成最新的版本号
导入开发包
import 'package:junny_dev_kit/junny_dev_kit.dart';
安卓的权限依赖 #
<!-- 访问网络状态-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<!-- 外置存储存取权限 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<!-- For android 11/R -->
<uses-permission
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<!-- For android 13/API33 -->
<!-- Add this if you need to take photos. -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<!--Starting with API 33. this permission is needed for notifications-->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- 控制呼吸灯,振动器等,用于新消息提醒 -->
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- 8.0+系统需要-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<queries>
<!-- Place inside the <queries> element. -->
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<!-- If your app checks for SMS support -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="sms" />
</intent>
<!-- If your app checks for call support -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="tel" />
</intent>
</queries>
一些依赖包需要在项目做的各种配置
background_downloader #
Android
No setup is required if you don't use notifications. If you do:
- Starting with API 33, you need to
add
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
to your app'sAndroidManifest.xml
- If needed, localize the button text by overriding string
resources
bg_downloader_cancel
,bg_downloader_pause
,bg_downloader_resume
and descriptionsbg_downloader_notification_channel_name
,bg_downloader_notification_channel_description
.
iOS
On iOS, ensure that you have the Background Fetch capability enabled:
- Select the Runner target in XCode
- Select the Signing & Capabilities tab
- Click the + icon to add capabilities
- Select 'Background Modes'
- Tick the 'Background Fetch' mode
Note that iOS by default requires all URLs to be https (and not http). See here for more details and how to address issues.
If using notifications, add the following to your AppDelegate.swift
:
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
or if using Objective C, add to AppDelegate.m
:
[UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>) self;