提交 709421fc authored 作者: JarvanMo's avatar JarvanMo

wechat sdk support

上级 20a7d2e2
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
......
......@@ -2,6 +2,7 @@ PODS:
- Flutter (1.0.0)
- wechat_plugin (0.0.1):
- Flutter
- WechatOpenSDK (~> 1.8.2)
- WechatOpenSDK (1.8.2)
DEPENDENCIES:
......@@ -21,9 +22,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
wechat_plugin: 8b62562c4add0cb3b036957b1c6f529fd92981bf
wechat_plugin: 101a04e102a362bdc87af3abf66a094cd654d926
WechatOpenSDK: 676feec516a11173eafd1fe64b10d27babf28701
PODFILE CHECKSUM: 348cd5f0a34c79cb5f6aaff87c10357738de9b8c
PODFILE CHECKSUM: 9663ba55aa377eec5ca2be16d9a7ad86f8d88698
COCOAPODS: 1.5.3
......@@ -270,12 +270,10 @@
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/wechat_plugin/wechat_plugin.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wechat_plugin.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
......
//
// Bridging-Header.h
// wechat_plugin
//
// Created by mo on 2018/8/13.
//
#ifndef Bridging_Header_h
#define Bridging_Header_h
@import UIKit; //使用1.6版必须有(PS:1.5版可以不要)
#import "WXApiObject.h"
#import "WXApi.h"
#endif /* Bridging_Header_h */
import Flutter
import UIKit
import wechat_plugin
public class SwiftWechatPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "wechat_plugin", binaryMessenger: registrar.messenger())
let instance = SwiftWechatPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "wechat_plugin", binaryMessenger: registrar.messenger())
let instance = SwiftWechatPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
switch call.method {
case WeChatPluginMethods.SHARE_TEXT:
print("hh")
break;
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
switch call.method {
case WeChatPluginMethods.SHARE_TEXT:
print("hh")
break;
default:
print("hh")
default:
print("hh")
}
}
}
}
//
// WeChatPluginMethods.swift
// Pods-Runner
//
// Created by mo on 2018/8/10.
//
import Foundation
public class WeChatPluginMethods {
public static let SHARE_TEXT = "shareText";
public static let SHARE_IMAGE = "shareImage";
public static let SHARE_MUSIC = "shareMusic";
public static let SHARE_VIDEO = "shareVideo";
public static let SHARE_WEBSITE = "shareWebsite";
}
......@@ -14,7 +14,10 @@ A Flutter plugin for wechat.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.static_framework = true
s.dependency 'Flutter'
s.dependency 'WechatOpenSDK', '~> 1.8.2'
s.ios.deployment_target = '8.0'
end
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论