提交 034c3394 authored 作者: knoyo's avatar knoyo

StringUtil renamed to FluwxStringUtil

上级 03dcd3d3
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#import "FluwxKeys.h" #import "FluwxKeys.h"
#import "StringToWeChatScene.h" #import "StringToWeChatScene.h"
#import "FluwxMethods.h" #import "FluwxMethods.h"
#import "StringUtil.h" #import "FluwxStringUtil.h"
#import "ThumbnailHelper.h" #import "ThumbnailHelper.h"
#import "NSStringWrapper.h" #import "NSStringWrapper.h"
...@@ -73,7 +73,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -73,7 +73,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
- (void)shareImage:(FlutterMethodCall *)call result:(FlutterResult)result { - (void)shareImage:(FlutterMethodCall *)call result:(FlutterResult)result {
NSString *imagePath = call.arguments[fluwxKeyImage]; NSString *imagePath = call.arguments[fluwxKeyImage];
if ([StringUtil isBlank:imagePath]) { if ([FluwxStringUtil isBlank:imagePath]) {
FlutterStandardTypedData *imageData = call.arguments[fluwxKeyImageData]; FlutterStandardTypedData *imageData = call.arguments[fluwxKeyImageData];
[self shareMemoryImage:call result:result imageData:imageData.data]; [self shareMemoryImage:call result:result imageData:imageData.data];
} else if ([imagePath hasPrefix:SCHEMA_ASSETS]) { } else if ([imagePath hasPrefix:SCHEMA_ASSETS]) {
...@@ -92,7 +92,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -92,7 +92,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
NSString *thumbnail = call.arguments[fluwxKeyThumbnail]; NSString *thumbnail = call.arguments[fluwxKeyThumbnail];
UIImage *thumbnailImage = nil; UIImage *thumbnailImage = nil;
if ([StringUtil isBlank:thumbnail]) { if ([FluwxStringUtil isBlank:thumbnail]) {
UIImage *tmp = [UIImage imageWithData:imageData]; UIImage *tmp = [UIImage imageWithData:imageData];
thumbnailImage = [ThumbnailHelper compressImage:tmp toByte:32 * 1024 isPNG:FALSE]; thumbnailImage = [ThumbnailHelper compressImage:tmp toByte:32 * 1024 isPNG:FALSE];
} else { } else {
...@@ -140,7 +140,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -140,7 +140,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
NSString *thumbnail = call.arguments[fluwxKeyThumbnail]; NSString *thumbnail = call.arguments[fluwxKeyThumbnail];
if ([StringUtil isBlank:thumbnail]) { if ([FluwxStringUtil isBlank:thumbnail]) {
thumbnail = imagePath; thumbnail = imagePath;
} }
...@@ -183,7 +183,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -183,7 +183,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
NSString *thumbnail = call.arguments[fluwxKeyThumbnail]; NSString *thumbnail = call.arguments[fluwxKeyThumbnail];
if ([StringUtil isBlank:thumbnail]) { if ([FluwxStringUtil isBlank:thumbnail]) {
thumbnail = imagePath; thumbnail = imagePath;
} }
...@@ -231,7 +231,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -231,7 +231,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
NSString *thumbnail = call.arguments[fluwxKeyThumbnail]; NSString *thumbnail = call.arguments[fluwxKeyThumbnail];
if ([StringUtil isBlank:thumbnail]) { if ([FluwxStringUtil isBlank:thumbnail]) {
thumbnail = imagePath; thumbnail = imagePath;
} }
...@@ -409,7 +409,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -409,7 +409,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
NSData *hdImageData = nil; NSData *hdImageData = nil;
NSString *hdImagePath = call.arguments[@"hdImagePath"]; NSString *hdImagePath = call.arguments[@"hdImagePath"];
if (![StringUtil isBlank:hdImagePath]) { if (![FluwxStringUtil isBlank:hdImagePath]) {
if ([hdImagePath hasPrefix:SCHEMA_ASSETS]) { if ([hdImagePath hasPrefix:SCHEMA_ASSETS]) {
hdImageData = [NSData dataWithContentsOfFile:[self readImageFromAssets:hdImagePath]]; hdImageData = [NSData dataWithContentsOfFile:[self readImageFromAssets:hdImagePath]];
...@@ -469,7 +469,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -469,7 +469,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
UIImage *thumbnailImage = nil; UIImage *thumbnailImage = nil;
if ([StringUtil isBlank:thumbnail]) { if ([FluwxStringUtil isBlank:thumbnail]) {
return nil; return nil;
} }
...@@ -504,7 +504,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -504,7 +504,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
- (NSString *)readImageFromAssets:(NSString *)imagePath { - (NSString *)readImageFromAssets:(NSString *)imagePath {
NSArray *array = [self formatAssets:imagePath]; NSArray *array = [self formatAssets:imagePath];
NSString *key; NSString *key;
if ([StringUtil isBlank:array[1]]) { if ([FluwxStringUtil isBlank:array[1]]) {
key = [_fluwxRegistrar lookupKeyForAsset:array[0]]; key = [_fluwxRegistrar lookupKeyForAsset:array[0]];
} else { } else {
key = [_fluwxRegistrar lookupKeyForAsset:array[0] fromPackage:array[1]]; key = [_fluwxRegistrar lookupKeyForAsset:array[0] fromPackage:array[1]];
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#import "FluwxWXApiHandler.h" #import "FluwxWXApiHandler.h"
#import "StringUtil.h" #import "FluwxStringUtil.h"
#import "FluwxPlugin.h" #import "FluwxPlugin.h"
#import "CallResults.h" #import "CallResults.h"
#import "FluwxKeys.h" #import "FluwxKeys.h"
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
} }
NSString *appId = call.arguments[@"appId"]; NSString *appId = call.arguments[@"appId"];
if ([StringUtil isBlank:appId]) { if ([FluwxStringUtil isBlank:appId]) {
result([FlutterError errorWithCode:@"invalid app id" message:@"are you sure your app id is correct ? " details:appId]); result([FlutterError errorWithCode:@"invalid app id" message:@"are you sure your app id is correct ? " details:appId]);
return; return;
} }
NSString *universalLink = call.arguments[@"universalLink"]; NSString *universalLink = call.arguments[@"universalLink"];
if ([StringUtil isBlank:universalLink]) { if ([FluwxStringUtil isBlank:universalLink]) {
result([FlutterError errorWithCode:@"invalid universal link" message:@"are you sure your universal link is correct ? " details:universalLink]); result([FlutterError errorWithCode:@"invalid universal link" message:@"are you sure your universal link is correct ? " details:universalLink]);
return; return;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface StringUtil : NSObject @interface FluwxStringUtil : NSObject
+ (BOOL)isBlank:(NSString *)string; + (BOOL)isBlank:(NSString *)string;
+ (NSString *)nilToEmpty:(NSString *)string; + (NSString *)nilToEmpty:(NSString *)string;
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
// Created by mo on 2018/8/15. // Created by mo on 2018/8/15.
// //
#import "StringUtil.h" #import "FluwxStringUtil.h"
@implementation StringUtil @implementation FluwxStringUtil
+ (BOOL)isBlank:(NSString *)string { + (BOOL)isBlank:(NSString *)string {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "WXApiRequestHandler.h" #import "WXApiRequestHandler.h"
#import "WechatAuthSDK.h" #import "WechatAuthSDK.h"
@class StringUtil; @class FluwxStringUtil;
@interface FluwxAuthHandler : NSObject <WechatAuthAPIDelegate> @interface FluwxAuthHandler : NSObject <WechatAuthAPIDelegate>
- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar methodChannel:(FlutterMethodChannel *)flutterMethodChannel; - (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar methodChannel:(FlutterMethodChannel *)flutterMethodChannel;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#import "FluwxPlugin.h" #import "FluwxPlugin.h"
@class StringUtil; @class FluwxStringUtil;
@interface FluwxLaunchMiniProgramHandler : NSObject @interface FluwxLaunchMiniProgramHandler : NSObject
- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar; - (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#import "FluwxPlugin.h" #import "FluwxPlugin.h"
@class StringUtil; @class FluwxStringUtil;
@interface FluwxPaymentHandler : NSObject @interface FluwxPaymentHandler : NSObject
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "FluwxPlugin.h" #import "FluwxPlugin.h"
#import "WXApiRequestHandler.h" #import "WXApiRequestHandler.h"
@class StringUtil; @class FluwxStringUtil;
@interface FluwxShareHandler : NSObject @interface FluwxShareHandler : NSObject
- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar; - (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "FluwxResponseHandler.h" #import "FluwxResponseHandler.h"
#import "FluwxKeys.h" #import "FluwxKeys.h"
#import "StringUtil.h" #import "FluwxStringUtil.h"
#import "WXApiObject.h" #import "WXApiObject.h"
#import "WXApi.h" #import "WXApi.h"
@implementation FluwxResponseHandler @implementation FluwxResponseHandler
...@@ -83,8 +83,8 @@ FlutterMethodChannel *fluwxMethodChannel = nil; ...@@ -83,8 +83,8 @@ FlutterMethodChannel *fluwxMethodChannel = nil;
country: authResp.country == nil ? @"" : authResp.country, country: authResp.country == nil ? @"" : authResp.country,
lang: authResp.lang == nil ? @"" : authResp.lang, lang: authResp.lang == nil ? @"" : authResp.lang,
fluwxKeyPlatform: fluwxKeyIOS, fluwxKeyPlatform: fluwxKeyIOS,
@"code": [StringUtil nilToEmpty:authResp.code], @"code": [FluwxStringUtil nilToEmpty:authResp.code],
@"state": [StringUtil nilToEmpty:authResp.state] @"state": [FluwxStringUtil nilToEmpty:authResp.state]
}; };
[fluwxMethodChannel invokeMethod:@"onAuthResponse" arguments:result]; [fluwxMethodChannel invokeMethod:@"onAuthResponse" arguments:result];
...@@ -172,8 +172,8 @@ FlutterMethodChannel *fluwxMethodChannel = nil; ...@@ -172,8 +172,8 @@ FlutterMethodChannel *fluwxMethodChannel = nil;
PayResp *payResp = (PayResp *) resp; PayResp *payResp = (PayResp *) resp;
NSDictionary *result = @{ NSDictionary *result = @{
description: [StringUtil nilToEmpty:payResp.description], description: [FluwxStringUtil nilToEmpty:payResp.description],
errStr: [StringUtil nilToEmpty:resp.errStr], errStr: [FluwxStringUtil nilToEmpty:resp.errStr],
errCode: @(payResp.errCode), errCode: @(payResp.errCode),
type: payResp == nil ? @5 : @(payResp.type), type: payResp == nil ? @5 : @(payResp.type),
@"returnKey": payResp.returnKey == nil ? @"" : payResp.returnKey, @"returnKey": payResp.returnKey == nil ? @"" : payResp.returnKey,
...@@ -184,8 +184,8 @@ FlutterMethodChannel *fluwxMethodChannel = nil; ...@@ -184,8 +184,8 @@ FlutterMethodChannel *fluwxMethodChannel = nil;
WXOpenBusinessWebViewResp *businessResp = (WXOpenBusinessWebViewResp *) resp; WXOpenBusinessWebViewResp *businessResp = (WXOpenBusinessWebViewResp *) resp;
NSDictionary *result = @{ NSDictionary *result = @{
description: [StringUtil nilToEmpty:businessResp.description], description: [FluwxStringUtil nilToEmpty:businessResp.description],
errStr: [StringUtil nilToEmpty:resp.errStr], errStr: [FluwxStringUtil nilToEmpty:resp.errStr],
errCode: @(businessResp.errCode), errCode: @(businessResp.errCode),
type: businessResp == nil ? @5 : @(businessResp.type), type: businessResp == nil ? @5 : @(businessResp.type),
@"resultInfo": businessResp.result, @"resultInfo": businessResp.result,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#import "WXApiRequestHandler.h" #import "WXApiRequestHandler.h"
#import "SendMessageToWXReq+requestWithTextOrMediaMessage.h" #import "SendMessageToWXReq+requestWithTextOrMediaMessage.h"
#import "WXMediaMessage+messageConstruct.h" #import "WXMediaMessage+messageConstruct.h"
#import "StringUtil.h" #import "FluwxStringUtil.h"
#import "WXApiObject.h" #import "WXApiObject.h"
@implementation WXApiRequestHandler @implementation WXApiRequestHandler
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
completion:(void (^ __nullable)(BOOL success))completion { completion:(void (^ __nullable)(BOOL success))completion {
WXMusicObject *ext = [WXMusicObject object]; WXMusicObject *ext = [WXMusicObject object];
if ([StringUtil isBlank:musicURL]) { if ([FluwxStringUtil isBlank:musicURL]) {
ext.musicLowBandUrl = musicLowBandUrl; ext.musicLowBandUrl = musicLowBandUrl;
ext.musicLowBandDataUrl = (musicLowBandDataUrl == (id) [NSNull null]) ? nil : musicLowBandDataUrl; ext.musicLowBandDataUrl = (musicLowBandDataUrl == (id) [NSNull null]) ? nil : musicLowBandDataUrl;
} else { } else {
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
[message setThumbImage:thumbImage]; [message setThumbImage:thumbImage];
WXVideoObject *ext = [WXVideoObject object]; WXVideoObject *ext = [WXVideoObject object];
if ([StringUtil isBlank:videoURL]) { if ([FluwxStringUtil isBlank:videoURL]) {
ext.videoLowBandUrl = videoLowBandUrl; ext.videoLowBandUrl = videoLowBandUrl;
} else { } else {
ext.videoUrl = videoURL; ext.videoUrl = videoURL;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论