junny_dev_kit 0.1.0-dev.84 copy "junny_dev_kit: ^0.1.0-dev.84" to clipboard
junny_dev_kit: ^0.1.0-dev.84 copied to clipboard


JunnySoft Dev Kit #


Getting Started #

  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 -->
        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" />
        <!-- Place inside the <queries> element. -->
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" />

        <!-- If your app checks for SMS support -->
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="sms" />

        <!-- If your app checks for call support -->
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="tel" />


background_downloader #


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's AndroidManifest.xml
  • If needed, localize the button text by overriding string resources bg_downloader_cancel, bg_downloader_pause, bg_downloader_resume and descriptions bg_downloader_notification_channel_name, bg_downloader_notification_channel_description.


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;