All Projects → linwaiwai → openapplus

linwaiwai / openapplus

Licence: other
专为小程序共享而生的小程序容器

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to openapplus

mpapi
🐤 小程序API兼容插件,一次编写,多端运行。支持:微信小程序、支付宝小程序、百度智能小程序、字节跳动小程序
Stars: ✭ 40 (-21.57%)
Mutual labels:  alipay, miniprogram
awesome-cml
awesome for chameleon
Stars: ✭ 66 (+29.41%)
Mutual labels:  alipay, miniprogram
Lin Ui
🌈 简洁、易用、灵活的微信小程序组件库
Stars: ✭ 3,264 (+6300%)
Mutual labels:  weixin, miniprogram
miniprogram
微信小程序过审指南
Stars: ✭ 96 (+88.24%)
Mutual labels:  weixin, miniprogram
Paylink
Paylink 是基于 .NET Core 、 ASP.NET Core 开发的支付SDK集,它极大简化了API调用及通知的处理流程。
Stars: ✭ 947 (+1756.86%)
Mutual labels:  alipay, weixin
comic-wx
微信小程序,仿腾讯动漫,界面美观,具备常用功能。WeiXin mini program,imitating TenCent comic, is very beautiful. I think, you would like it
Stars: ✭ 60 (+17.65%)
Mutual labels:  weixin, miniprogram
YHThirdManager
一个快速、简单、易集成、扩展性好的社交化组件。摒弃友盟等三方库,使用原生SDK。支持微信支付、微信分享、微信登录、微信授权、QQ授权、QQ分享、QQ登录、新浪授权、新浪登录、新浪分享、微博评论、微博获取、支付宝支付。极大的减小了包体积;同时加入了自动管理提示框的功能
Stars: ✭ 41 (-19.61%)
Mutual labels:  alipay, weixin
miniprogram
[微信小程序/小游戏] A fast wechat miniprogram/minigame development sdk written in Golang
Stars: ✭ 52 (+1.96%)
Mutual labels:  weixin, miniprogram
Sns auth
通用第三方登录SDK,支持微信,微信扫码,QQ,微博登录,支付宝登录,Facebook,Line,Twitter,Google
Stars: ✭ 520 (+919.61%)
Mutual labels:  alipay, weixin
Pay
可能是我用过的最优雅的 Alipay 和 WeChat 的支付 SDK 扩展包了
Stars: ✭ 4,176 (+8088.24%)
Mutual labels:  alipay, weixin
Wux Weapp
🐶 一套组件化、可复用、易扩展的微信小程序 UI 组件库
Stars: ✭ 4,706 (+9127.45%)
Mutual labels:  weixin, miniprogram
Wxapp Webpack Plugin
📦 微信小程序 webpack 插件
Stars: ✭ 185 (+262.75%)
Mutual labels:  alipay, weixin
Ijpay
IJPay 让支付触手可及,封装了微信支付、QQ支付、支付宝支付、京东支付、银联支付、PayPal 支付等常用的支付方式以及各种常用的接口。不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。右上角点下小星星✨
Stars: ✭ 3,561 (+6882.35%)
Mutual labels:  alipay, weixin
Teepay
Typecho 个人支付宝、微信收款插件
Stars: ✭ 90 (+76.47%)
Mutual labels:  alipay, weixin
Sdk3rd
第三方SDK集成库,授权/分享/支付
Stars: ✭ 249 (+388.24%)
Mutual labels:  alipay, weixin
wechat-page-sharing
Wordpress微信分享插件:你可以控制Wordpress页面的微信分享内容,包括Url、标题、图片和内容。
Stars: ✭ 21 (-58.82%)
Mutual labels:  weixin
ZmopSharp
ZMOP (芝麻信用开放平台) SDK for .NET
Stars: ✭ 11 (-78.43%)
Mutual labels:  alipay
ZTVendorManager
基于友盟集成QQ,微信 ,微博 分享和登录功能,支付宝和微信支付功能。集成简单,使用方便。
Stars: ✭ 26 (-49.02%)
Mutual labels:  alipay
XposedManyMoney
Xposed 修改微信、QQ、TIM、支付宝余额。
Stars: ✭ 36 (-29.41%)
Mutual labels:  alipay
react-native-alipay
基于 React Native 的宝支付包,已更新到最新的支付宝 SDK 版本,支持Android/iOS。
Stars: ✭ 166 (+225.49%)
Mutual labels:  alipay

OpenApplus

官方网站

http://www.openapplus.com

捐赠热线:

Donate with Alipay or Wechat Pay

捐赠的同学如果要联系我,麻烦在付款方备注留下您的微信联系方式,以便我加你。

参考链接

http://www.jianshu.com/p/9c289f784928

iOS集成

Cocoapods 安装

推荐使用 CocoaPods 的方式安装使用。

CocoaPods 是一个广泛适用于Objective-C依赖管理工具,能够自动配置项目,简化你配置Openapp+的过程,使用以下命令行安装

$ gem install cocoapods

OpenApplus 安装

使用CocosPods集成Openapp+到Xcode

在Podfile文件加入

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
#忽略引入库的警告
inhibit_all_warnings!

target 'openapplus-ios-demo' do
    pod 'OpenApplus', '~> 1.3.8'
end

在工程中Info.plist文件中添加如下项

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
   <true/>
</dict>

运行

在 AppDelegate.m 里按顺序调用三个方法:

1、调用 +startWithAppKey: ,参数为第一步获得的 AppKey。

2、调用 +sync 方法检查包更新。

在AppDelegate.m或ViewController.m中调用 navigateToMiniProgram: 加载小程序项目,参数为在平台中创建的项目的名称。

  #import <"openapplus/openapplus.h">
  @implementation AppDelegate
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:testViewController];
      self.window.rootViewController = navigationController;
      [self.window makeKeyAndVisible];

      [OpenApplus startWithAppKey:@"test"];
      [OpenApplus sync];
      [OpenApplus setNavigationController:navigationController];
      // JS_APPID 为小程序的APP_ID
      [OpenApplus navigateToMiniProgram:@"openapplus://jsApp/#JS_APPID#" completion:^{
        
      }];

      ...
  }
  @end

上述例子是把 Openapplus 同步放在 -application:didFinishLaunchingWithOptions: 里,若希望包能及时推送,可以把 [OpenApplus sync] 放在 -applicationDidBecomeActive: 里,每次唤醒都能同步更新 OpenApplus 包,不需要等用户下次启动。

Android集成

Android Studio集成

下载SDK功能组件,解压.zip文件得到相应组件包(openapplus-release.aar),在Android Studio的项目工程libs目录中拷入相关组件jar包。 右键Android Studio的项目工程—>选择Open Module Settings —>在 Project Structure弹出框中 —>选择 Dependencies选项卡 —>点击左下“+”—>选择组件包类型—>引入相应的组件包。

或者使用gradle

buildscript {
    repositories {
        jcenter()
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
dependencies{
   implementation ('com.openapplus:openapplus:1.0.3')
   implementation 'com.eclipsesource.j2v8:j2v8:6.1.0@aar'
}

详细添加位置请参考DEMO[https://github.com/linwaiwai/openapplus-demo/blob/master/Android/]

运行

在项目工程的自定义application中的onCreate方法中添加以下两个方法: 注意:一定要在主进程进行该项操作

OpenApplus.registerApp(this, SampleContants.APPID, SampleContants.APP_SECRET);
OpenApplus.sync();
OpenApplus.setCallback(new OpenApplusCallback() {
            @Override
            public void invoke(OACallbackType type, JSONObject data, OpenApplusNotify notify) {
                if (type == OACallbackType.OACallbackTypeAuthUser){
                    // 该接口仅供测试使用,请使用服务端发送给授权请求
                    OARequestWrapper requestWrapper = OpenApplus.makeRequestWrapper(SampleContants.SERVER_APPID, SampleContants.SERVER_APP_SECRET);
                    OAAuthDtoWrapper dto = new OAAuthDtoWrapper();
                    dto.setUid("1");
                    try {
                        dto.setCode(data.getString("code"));
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                    String deviceID = Settings.Secure.getString(WXEnvironment.sApplication.getApplicationContext().getContentResolver(),
                            Settings.Secure.ANDROID_ID);
                    dto.setDeviceid(deviceID);
                    requestWrapper.sendObject(dto, notify);
                }
            }
});

注意:

参数1:上下文,必须的参数,不能为空

参数2:OpenApplus app key,必须参数。

参数3:OpenApplus app secret,必须参数。

添加相关权限

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_LOGS"/>
<!-- 这个权限用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!-- 这个权限用于访问GPS定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>

<uses-permission android:name="android.permission.ACCESS_GPS"/>

<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>

<uses-permission android:name="getui.permission.GetuiService.com.bmdoctor.jyt"/>

<!--amap额外权限-->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>

代码混淆

如果您的应用使用了混淆, 请添加

-keep class com.openapplus.** {*;}

添加Activty入口

在AndroidManifest.xml中添加

<activity android:name="com.openapplus.activity.OATinyProgramActivity">
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>

        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="com.benmu.weex.example.categoty.page"/>

        <data android:scheme="http"/>
        <data android:scheme="https"/>
    </intent-filter>
</activity>

启动小程序容器

Intent intent = new Intent(SplashActivity.this, OATinyProgramActivity.class);
intent.putExtra("tiny","openapplus://jsApp/xxxxx");
startActivity(intent);
finish();

Codova支持

自动安装

安装cordova
> npm install -g cordova
> cordova create MyApp
> cd Cordova-Demo
> cordova platform add ios
> cordova plugin add @openapplus/cordova-openapplus-plugin
编写codova插件调用函数
function onButtonClicked(){
    var CordovaOpenApplusPlugin = cordova.plugins.CordovaOpenApplusPlugin;
    CordovaOpenApplusPlugin.navigateToMiniProgram("openapplus://jsApp/Lr12JhPrE9bg7N4uoABBXY");
}
var app = {
    // Application Constructor
    initialize: function() {
        document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
    },

    // deviceready Event Handler
    //
    // Bind any cordova events here. Common events are:
    // 'pause', 'resume', etc.
    onDeviceReady: function() {
        this.receivedEvent('deviceready');
        var CordovaOpenApplusPlugin = cordova.plugins.CordovaOpenApplusPlugin;
        CordovaOpenApplusPlugin.start("oa606f78973e434c78933b869d8ba73c59","$2a$10$4bbR9ZNAhm74x3sckSLf/uPyR.E2JQvACCHP4xKtLt/OOpbJsiq9q");
        CordovaOpenApplusPlugin.enableLogging(true);

        document.querySelector('button').addEventListener('click', onButtonClicked);
    },

    // Update DOM on a Received Event
    receivedEvent: function(id) {
        var parentElement = document.getElementById(id);
        var listeningElement = parentElement.querySelector('.listening');
        var receivedElement = parentElement.querySelector('.received');

        listeningElement.setAttribute('style', 'display:none;');
        receivedElement.setAttribute('style', 'display:block;');

        console.log('Received Event: ' + id);
    }
};

app.initialize();
完整Demo下载地址

https://github.com/linwaiwai/openapplus-demo/

手动安装

下载插件

1、在Demo中找到插件下载CordovaOpenApplusPlugin 2、修改插件配置文件plugin.xml

<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-openapplus-plugin" version="0.0.4" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
	<name>CordovaOpenApplusPlugin</name>
	<js-module name="CordovaOpenApplusPlugin" src="www/CordovaOpenApplusPlugin.js">
		<clobbers target="cordova.plugins.CordovaOpenApplusPlugin" />
	</js-module>
	<platform name="ios">
		<config-file parent="/*" target="config.xml">
			<feature name="CordovaOpenApplusPlugin">
				<param name="ios-package" value="CordovaOpenApplusPlugin" />
			</feature>
		</config-file>
		<source-file src="src/ios/CordovaOpenApplusPlugin.m" />
		<!-- <framework src="lib/OpenApplus.framework" embed="true" custom="true" /> -->
		<podspec>
		  <config>
		    <source url="https://github.com/CocoaPods/Specs.git"/>
		  </config>
		  <pods use-frameworks="true">
		  <!--   <pod name="SDWebImage"  spec="3.7.5" />
			<pod name="SSZipArchive"  spec="1.6.2" />
			<pod name="SVProgressHUD"   spec="2.1.2" />
			<pod name="UMengUShare/Social/WeChat"   spec="6.3.0" />
			<pod name="MJRefresh"   spec="3.1.12" />
			<pod name="libextobjc"   spec="~> 0.4.1" />
			<pod name="AFNetworking"   spec="~> 3.2.1" /> -->
			<pod name="OpenApplus"   podspec="../../plugins/cordova-openapplus-plugin/podspec/OpenApplus.podspec" />
		  </pods>
		</podspec>
	</platform>
</plugin>

<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-openapplus-plugin" version="0.0.4" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
	<name>CordovaOpenApplusPlugin</name>
	<js-module name="CordovaOpenApplusPlugin" src="www/CordovaOpenApplusPlugin.js">
		<clobbers target="cordova.plugins.CordovaOpenApplusPlugin" />
	</js-module>
	<platform name="ios">
		<config-file parent="/*" target="config.xml">
			<feature name="CordovaOpenApplusPlugin">
				<param name="ios-package" value="CordovaOpenApplusPlugin" />
			</feature>
		</config-file>
		<source-file src="src/ios/CordovaOpenApplusPlugin.m" />
		<framework src="lib/OpenApplus.framework" embed="true" custom="true" />
		<podspec>
		  <config>
		    <source url="https://github.com/CocoaPods/Specs.git"/>
		  </config>
		  <pods use-frameworks="true">
		        <pod name="SDWebImage"  spec="3.7.5" />
			<pod name="SSZipArchive"  spec="1.6.2" />
			<pod name="SVProgressHUD"   spec="2.1.2" />
			<pod name="UMengUShare/Social/WeChat"   spec="6.3.0" />
			<pod name="MJRefresh"   spec="3.1.12" />
			<pod name="libextobjc"   spec="~> 0.4.1" />
			<pod name="AFNetworking"   spec="~> 3.2.1" /> -->
		  </pods>
		</podspec>
	</platform>
</plugin>

3、创建lib目录,下载OpenApplus.framework 到 lib目录下 4、cordova plugin add path/to/CordovaOpenApplusPlugin

问题

1、lipo -info OpenApplus.framework/OpenApplus 如果发现缺少arm64支持,请下载压缩包的内容覆盖,可能是下载的问题。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].