npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugins-ths-email

v1.1.1

Published

基于第三方外包人员提供的 aar 进行二次开发的邮箱插件(aar 提供者,郭海洋,插件开发者 Mr. Liu)

Downloads

3

Readme

cordova-plugins-ths-email

基于第三方外包人员提供的 aar 进行二次开发的邮箱插件(aar 提供者,郭海洋,插件开发者 Mr. Liu)

*** 2022.1.1新增发送邮件方法、修改初始化登录状态方法 ***

*** 2022.1.10新增获取缓存邮件个数方法、修改初始化登录状态方法,增加昵称字段 ***

使用示例

1 登录邮箱服务,使用邮箱功能前此方法需要先调用


  /**
   * 登录 邮件服务器,该方法在登录app的时候调用
   * @param mUserName 邮箱系统的用户名
   * @param mUserPassword 邮箱系统的密码
   * @param mUserNick 昵称,中文名,用于显示在收发件人处
   * @param mImapHost IMAP 服务地址
   * @param mImapPort IMAP 端口
   * @param mSmtpHost SMTP 主机地址
   * @param mSmtpPort SMTP 端口
   * @param mImapSsl IMAP是否支持SSL
   * @param mSmtpSsl SMTP是否支持SSL
   */
(window as any).cordova.plugins.ThsEmail.tryLogin(mUserName,mUserPassword,mUserNick,mImapHost,mImapPort,mSmtpHost,mSmtpPort,mImapSsl,mSmtpSsl,(res) => {
  console.log(123);
alert(res);
},()=> {
  console.log(123);
});

2 初始化登录状态,再操作邮箱功能前调用该方法

/**
 * 初始化登录状态
 * @param {*} emailsJsonStr 设置邮件列表,用于发送邮件时输入提示,例如:json 格式的字符串 [{"email":"[email protected]","nickName":"潘飞"},{"email":"[email protected]","nickName":"莆铮"}]
 * @param {*} success 
 * @param {*} error 
 */
(window as any).cordova.plugins.ThsEmail.initLogin( '[{"email":"[email protected]"},{"email":"[email protected]"}]',(res) => {
console.log(123);
alert(res);
},()=> {
console.log(123);
});

3 跳转到消息列表页面

(window as any).cordova.plugins.ThsEmail.gotoMsgList( (res) => {
console.log(123);
alert(res);
},()=> {
console.log(123);
});

4 绑定未读消息监听

(window as any).cordova.plugins.ThsEmail.bindUnreadMsgListener( (res) => {
console.log(123);
alert(res);
},()=> {
console.log(123);
});

5 移除未读消息监听

(window as any).cordova.plugins.ThsEmail.removeMsgCountListener( (res) => {
console.log(123);
alert(res);
},()=> {
console.log(123);
});

6 发送邮件

/**
 * 跳转到发送邮件的界面
 * @param {*} emailsJsonStr 设置收件人邮件列表,例如:json 格式的字符串 [{"email":"[email protected]"},{"email":"[email protected]"}],如果初始化登录数据的时候设置了昵称,此处也可以传递[{"email":"潘飞"},{"email":"莆铮"}]
 * @param {*} success 
 * @param {*} error 
 */
(window as any).cordova.plugins.ThsEmail.gotoWrite( '[{"email":"[email protected]"},{"email":"[email protected]"}]',(res) => {
console.log(123);
alert(res);
},()=> {
console.log(123);
});

7 监听未读邮件数量(注意不要重复监听,在页面移除时,移除监听,页面重新加载时重新监听)

document.addEventListener('ThsEmail.onMsgCountListenerInAndroidCallback', data => {
      console.log(data);
      alert(JSON.stringify(data));
}, false);

8 获取缓存未读邮件数量

(window as any).cordova.plugins.ThsEmail.getMsgCount( (res) => {
console.log(123);
alert(res);
},()=> {
console.log(123);
});

常见错误

1 The minCompileSdk (31) specified in a

dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.lifecycle:lifecycle-runtime:2.4.0. AAR metadata file: C:\Users\Administrator.gradle\caches\transforms-3\e1b9a522463849a0cab234c5800addbc\transformed\lifecycle-runtime-2.4.0\META-INF\com\android\build\gradle\aar-metadata.properties.

分析:Android编译的版本与aar 中依赖的版本不一致

解决:根据错误信息位置路径修改版本为30,比如该错误文件C:\Users\Administrator.gradle\caches\transforms-3\e1b9a522463849a0cab234c5800addbc\transformed\lifecycle-runtime-2.4.0\META-INF\com\android\build\gradle\aar-metadata.properties

2 > Task :app:processDebugMainManifest FAILED

D:\workspace\beijing\beijingju\mobileoa\code\android\app\src\main\AndroidManifest.xml:30:13-64 Error: Attribute provider#androidx.core.content.FileProvider@authorities value=(io.ionic.starter.fileprovider) from AndroidManifest.xml:30:13-64 is also present at [:mail:] AndroidManifest.xml:21:13-60 value=(io.ionic.starter.provider). Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:28:9-36:20 to override. D:\workspace\beijing\beijingju\mobileoa\code\android\app\src\main\AndroidManifest.xml:35:17-51 Error: Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/file_paths) from AndroidManifest.xml:35:17-51 is also present at [:mail:] AndroidManifest.xml:26:17-55 value=(@xml/provider_paths). Suggestion: add 'tools:replace="android:resource"' to element at AndroidManifest.xml:33:13-35:64 to override.

分析: aar 中清单文件中存在于主应用存在冲突

解决:按照错误提示替换掉aar中配置

<provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            tools:replace="android:authorities"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths"
                tools:replace="android:resource"
                ></meta-data>
        </provider>