plugin.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
  3. xmlns:rim="http://www.blackberry.com/ns/widgets"
  4. xmlns:android="http://schemas.android.com/apk/res/android"
  5. id="cordova-plugin-wechat"
  6. version="3.0.0">
  7. <name>Wechat</name>
  8. <description>A cordova plugin, a JS version of Wechat SDK</description>
  9. <license>MIT</license>
  10. <keywords>cordova,wechat,weixin,share</keywords>
  11. <repo>https://github.com/xu-li/cordova-plugin-wechat.git</repo>
  12. <issue>https://github.com/xu-li/cordova-plugin-wechat/issues</issue>
  13. <!-- add this to your config.xml -->
  14. <!-- <preference name="WECHATAPPID" value="YOUR_WECHAT_APP_ID_HERE" /> -->
  15. <preference name="WECHATAPPID" />
  16. <preference name="UNIVERSALLINK" />
  17. <!-- js module-->
  18. <js-module src="www/wechat.js" name="Wechat">
  19. <clobbers target="Wechat" />
  20. </js-module>
  21. <!-- ios -->
  22. <platform name="ios">
  23. <config-file target="config.xml" parent="/*">
  24. <feature name="Wechat">
  25. <param name="ios-package" value="CDVWechat"/>
  26. <param name="onload" value="true" />
  27. </feature>
  28. <preference name="WECHATAPPID" value="$WECHATAPPID"/>
  29. <preference name="UNIVERSALLINK" value="$UNIVERSALLINK"/>
  30. </config-file>
  31. <config-file target="*-Info.plist" parent="LSApplicationQueriesSchemes">
  32. <array>
  33. <string>weixin</string>
  34. <string>wechat</string>
  35. <string>weixinULAPI</string>
  36. </array>
  37. </config-file>
  38. <config-file target="*-Info.plist" parent="NSAppTransportSecurity">
  39. <dict>
  40. <key>NSAllowsArbitraryLoads</key>
  41. <true/>
  42. </dict>
  43. </config-file>
  44. <config-file target="*-Info.plist" parent="CFBundleURLTypes">
  45. <array>
  46. <dict>
  47. <key>CFBundleURLName</key>
  48. <string>weixin</string>
  49. <key>CFBundleURLSchemes</key>
  50. <array>
  51. <string>$WECHATAPPID</string>
  52. </array>
  53. </dict>
  54. </array>
  55. </config-file>
  56. <!-- Plugin source code -->
  57. <header-file src="src/ios/CDVWechat.h" />
  58. <source-file src="src/ios/CDVWechat.m" />
  59. <header-file src="src/ios/AppDelegate+Wechat.h" />
  60. <source-file src="src/ios/AppDelegate+Wechat.m" />
  61. <!-- Wechat Official -->
  62. <header-file src="src/ios/libs/OpenSDK1.8.6.2/WXApi.h" />
  63. <header-file src="src/ios/libs/OpenSDK1.8.6.2/WXApiObject.h" />
  64. <header-file src="src/ios/libs/OpenSDK1.8.6.2/WechatAuthSDK.h" />
  65. <source-file src="src/ios/libs/OpenSDK1.8.6.2/libWeChatSDK.a" framework="true" />
  66. <!-- Other required frameworks -->
  67. <framework src="libz.tbd" />
  68. <framework src="libsqlite3.0.tbd" />
  69. <framework src="CoreTelephony.framework" />
  70. <framework src="SystemConfiguration.framework" />
  71. <framework src="Security.framework" />
  72. <framework src="CFNetwork.framework" />
  73. <framework src="CoreGraphics.framework" />
  74. <framework src="Webkit.framework" />
  75. <framework src="libc++.1.tbd" />
  76. </platform>
  77. <!-- android -->
  78. <platform name="android">
  79. <hook type="after_plugin_add" src="scripts/android-install.js" />
  80. <hook type="after_plugin_install" src="scripts/android-install.js" />
  81. <hook type="before_plugin_rm" src="scripts/android-install.js" />
  82. <hook type="before_plugin_uninstall" src="scripts/android-install.js" />
  83. <config-file target="res/xml/config.xml" parent="/*">
  84. <feature name="Wechat">
  85. <param name="android-package" value="xu.li.cordova.wechat.Wechat"/>
  86. </feature>
  87. <preference name="WECHATAPPID" value="$WECHATAPPID"/>
  88. </config-file>
  89. <config-file target="AndroidManifest.xml" parent="/*">
  90. <uses-permission android:name="android.permission.INTERNET"/>
  91. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  92. <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  93. <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  94. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  95. </config-file>
  96. <config-file target="AndroidManifest.xml" parent="/manifest/application">
  97. <activity
  98. android:name=".wxapi.WXEntryActivity"
  99. android:label="@string/launcher_name"
  100. android:exported="true"
  101. android:taskAffinity="$PACKAGE_NAME"
  102. android:launchMode="singleTask">
  103. <intent-filter>
  104. <action android:name="android.intent.action.VIEW"/>
  105. <category android:name="android.intent.category.DEFAULT"/>
  106. <data android:scheme="$WECHATAPPID"/>
  107. </intent-filter>
  108. </activity>
  109. <activity
  110. android:name=".wxapi.WXPayEntryActivity"
  111. android:label="@string/launcher_name"
  112. android:exported="true"
  113. android:launchMode="singleTop">
  114. <intent-filter>
  115. <action android:name="android.intent.action.VIEW"/>
  116. <category android:name="android.intent.category.DEFAULT"/>
  117. <data android:scheme="$WECHATAPPID"/>
  118. </intent-filter>
  119. </activity>
  120. </config-file>
  121. <source-file src="src/android/Wechat.java" target-dir="src/xu/li/cordova/wechat" />
  122. <source-file src="src/android/Util.java" target-dir="src/xu/li/cordova/wechat" />
  123. <framework src="android-build.gradle" custom="true" type="gradleReference" />
  124. </platform>
  125. </plugin>