plugin.xml 5.3 KB

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