plugin.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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="1.4.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. <!--require cordova version -->
  17. <engines>
  18. <engine name="cordova" version=">=3.5.0" />
  19. </engines>
  20. <!-- js module-->
  21. <js-module src="www/wechat.js" name="Wechat">
  22. <clobbers target="Wechat" />
  23. </js-module>
  24. <!-- ios -->
  25. <platform name="ios">
  26. <config-file target="config.xml" parent="/*">
  27. <feature name="Wechat">
  28. <param name="ios-package" value="CDVWechat"/>
  29. <param name="onload" value="true" />
  30. </feature>
  31. <preference name="WECHATAPPID" value="$WECHATAPPID"/>
  32. </config-file>
  33. <config-file target="*-Info.plist" parent="LSApplicationQueriesSchemes">
  34. <array>
  35. <string>weixin</string>
  36. <string>wechat</string>
  37. </array>
  38. </config-file>
  39. <config-file target="*-Info.plist" parent="NSAppTransportSecurity">
  40. <dict>
  41. <key>NSAllowsArbitraryLoads</key>
  42. <true/>
  43. </dict>
  44. </config-file>
  45. <config-file target="*-Info.plist" parent="CFBundleURLTypes">
  46. <array>
  47. <dict>
  48. <key>CFBundleURLName</key>
  49. <string>weixin</string>
  50. <key>CFBundleURLSchemes</key>
  51. <array>
  52. <string>$WECHATAPPID</string>
  53. </array>
  54. </dict>
  55. </array>
  56. </config-file>
  57. <!-- Plugin source code -->
  58. <header-file src="src/ios/CDVWechat.h" />
  59. <source-file src="src/ios/CDVWechat.m" />
  60. <!-- Wechat Official -->
  61. <header-file src="src/ios/libs/OpenSDK1.7.5/WXApi.h" />
  62. <header-file src="src/ios/libs/OpenSDK1.7.5/WXApiObject.h" />
  63. <source-file src="src/ios/libs/OpenSDK1.7.5/libWeChatSDK.a" framework="true" />
  64. <!-- Other required frameworks -->
  65. <framework src="libz.tbd" />
  66. <framework src="libsqlite3.0.tbd" />
  67. <framework src="CoreTelephony.framework" />
  68. <framework src="SystemConfiguration.framework" />
  69. <framework src="Security.framework" />
  70. <framework src="CFNetwork.framework" />
  71. <framework src="libstdc++.6.tbd" />
  72. </platform>
  73. <!-- android -->
  74. <platform name="android">
  75. <hook type="after_plugin_add" src="scripts/android-install.js" />
  76. <hook type="after_plugin_install" src="scripts/android-install.js" />
  77. <hook type="before_plugin_rm" src="scripts/android-install.js" />
  78. <hook type="before_plugin_uninstall" src="scripts/android-install.js" />
  79. <config-file target="res/xml/config.xml" parent="/*">
  80. <feature name="Wechat">
  81. <param name="android-package" value="xu.li.cordova.wechat.Wechat"/>
  82. </feature>
  83. <preference name="WECHATAPPID" value="$WECHATAPPID"/>
  84. </config-file>
  85. <config-file target="AndroidManifest.xml" parent="/*">
  86. <uses-permission android:name="android.permission.INTERNET"/>
  87. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  88. <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  89. <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  90. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  91. </config-file>
  92. <config-file target="AndroidManifest.xml" parent="/manifest/application">
  93. <activity
  94. android:name=".wxapi.WXEntryActivity"
  95. android:label="@string/launcher_name"
  96. android:exported="true">
  97. <intent-filter>
  98. <action android:name="android.intent.action.VIEW"/>
  99. <category android:name="android.intent.category.DEFAULT"/>
  100. <data android:scheme="$WECHATAPPID"/>
  101. </intent-filter>
  102. </activity>
  103. <activity
  104. android:name=".wxapi.WXPayEntryActivity"
  105. android:label="@string/launcher_name"
  106. android:exported="true"
  107. android:launchMode="singleTop">
  108. <intent-filter>
  109. <action android:name="android.intent.action.VIEW"/>
  110. <category android:name="android.intent.category.DEFAULT"/>
  111. <data android:scheme="$WECHATAPPID"/>
  112. </intent-filter>
  113. </activity>
  114. </config-file>
  115. <source-file src="src/android/Wechat.java" target-dir="src/xu/li/cordova/wechat" />
  116. <source-file src="src/android/Util.java" target-dir="src/xu/li/cordova/wechat" />
  117. <source-file src="src/android/libammsdk.jar" target-dir="libs" />
  118. </platform>
  119. </plugin>