Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢冠章
flutter_boost_1.22.4
Commits
6e0d8ada
Commit
6e0d8ada
authored
6 years ago
by
Jidong Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove xservice kit update
parent
55b0aaf8
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
547 additions
and
115 deletions
+547
-115
ios/Classes/Boost/FlutterBoostPlugin.m
ios/Classes/Boost/FlutterBoostPlugin.m
+50
-17
ios/Classes/Boost/FlutterBoostPlugin_private.h
ios/Classes/Boost/FlutterBoostPlugin_private.h
+1
-2
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_closePage.h
.../NavigationService/handlers/NavigationService_closePage.h
+4
-3
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_closePage.mm
...NavigationService/handlers/NavigationService_closePage.mm
+10
-11
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_onFlutterPageResult.h
...nService/handlers/NavigationService_onFlutterPageResult.h
+3
-3
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_onFlutterPageResult.mm
...Service/handlers/NavigationService_onFlutterPageResult.mm
+5
-9
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_onShownContainerChanged.h
...vice/handlers/NavigationService_onShownContainerChanged.h
+3
-3
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_onShownContainerChanged.mm
...ice/handlers/NavigationService_onShownContainerChanged.mm
+5
-8
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_openPage.h
...d/NavigationService/handlers/NavigationService_openPage.h
+3
-3
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_openPage.mm
.../NavigationService/handlers/NavigationService_openPage.mm
+4
-8
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_pageOnStart.h
...avigationService/handlers/NavigationService_pageOnStart.h
+2
-2
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_pageOnStart.mm
...vigationService/handlers/NavigationService_pageOnStart.mm
+10
-13
ios/Classes/Messaging/Generated/NavigationService/service/Service_NavigationService.h
...ted/NavigationService/service/Service_NavigationService.h
+4
-5
ios/Classes/Messaging/Generated/NavigationService/service/Service_NavigationService.mm
...ed/NavigationService/service/Service_NavigationService.mm
+15
-26
ios/Classes/Messaging/base/FLBMessageDispather.h
ios/Classes/Messaging/base/FLBMessageDispather.h
+30
-0
ios/Classes/Messaging/base/FLBMessageDispather.m
ios/Classes/Messaging/base/FLBMessageDispather.m
+78
-0
ios/Classes/Messaging/base/FLBMessageHandlerImp.h
ios/Classes/Messaging/base/FLBMessageHandlerImp.h
+30
-0
ios/Classes/Messaging/base/FLBMessageHandlerImp.m
ios/Classes/Messaging/base/FLBMessageHandlerImp.m
+168
-0
ios/Classes/Messaging/base/FLBMessageImp.h
ios/Classes/Messaging/base/FLBMessageImp.h
+36
-0
ios/Classes/Messaging/base/FLBMessageImp.m
ios/Classes/Messaging/base/FLBMessageImp.m
+38
-0
ios/Classes/Messaging/base/FLBMessageing.h
ios/Classes/Messaging/base/FLBMessageing.h
+48
-0
ios/flutter_boost.podspec
ios/flutter_boost.podspec
+0
-2
No files found.
ios/Classes/Boost/FlutterBoostPlugin.m
View file @
6e0d8ada
...
...
@@ -28,8 +28,57 @@
#import "FLBFactory.h"
#import "FLB2Factory.h"
#import "FLBMessageDispather.h"
#import "FLBMessageImp.h"
#import "NavigationService_closePage.h"
#import "NavigationService_openPage.h"
#import "NavigationService_pageOnStart.h"
#import "NavigationService_onShownContainerChanged.h"
#import "NavigationService_onFlutterPageResult.h"
@interface
FlutterBoostPlugin
()
@property
(
nonatomic
,
strong
)
FLBMessageDispather
*
dispatcher
;
@end
@implementation
FlutterBoostPlugin
+
(
void
)
registerWithRegistrar
:(
NSObject
<
FlutterPluginRegistrar
>*
)
registrar
{
FlutterMethodChannel
*
channel
=
[
FlutterMethodChannel
methodChannelWithName:
@"flutter_boost"
binaryMessenger:
[
registrar
messenger
]];
FlutterBoostPlugin
*
instance
=
[
self
.
class
sharedInstance
];
instance
.
methodChannel
=
channel
;
[
registrar
addMethodCallDelegate
:
instance
channel
:
channel
];
}
-
(
void
)
handleMethodCall
:(
FlutterMethodCall
*
)
call
result
:(
FlutterResult
)
result
{
if
([
@"getPlatformVersion"
isEqualToString
:
call
.
method
])
{
result
([
@"iOS "
stringByAppendingString
:[[
UIDevice
currentDevice
]
systemVersion
]]);
}
else
{
FLBMessageImp
*
msg
=
FLBMessageImp
.
new
;
msg
.
name
=
call
.
method
;
msg
.
params
=
call
.
arguments
;
if
(
!
[
self
.
dispatcher
dispatch
:
msg
result
:
result
]){
result
(
FlutterMethodNotImplemented
);
}
}
}
-
(
void
)
registerHandlers
{
NSArray
*
handlers
=
@[
NavigationService_openPage
.
class
,
NavigationService_closePage
.
class
,
NavigationService_pageOnStart
.
class
,
NavigationService_onShownContainerChanged
.
class
,
NavigationService_onFlutterPageResult
.
class
];
for
(
Class
cls
in
handlers
){
[
self
.
dispatcher
registerHandler
:
cls
.
new
];
}
}
+
(
instancetype
)
sharedInstance
{
static
id
_instance
=
nil
;
...
...
@@ -45,6 +94,7 @@
{
if
(
self
=
[
super
init
])
{
_resultMediator
=
[
FLBResultMediator
new
];
[
self
registerHandlers
];
}
return
self
;
...
...
@@ -65,23 +115,6 @@
return
_factory
;
}
+
(
void
)
registerWithRegistrar
:(
NSObject
<
FlutterPluginRegistrar
>*
)
registrar
{
FlutterMethodChannel
*
channel
=
[
FlutterMethodChannel
methodChannelWithName:
@"flutter_boost"
binaryMessenger:
[
registrar
messenger
]];
FlutterBoostPlugin
*
instance
=
[
self
.
class
sharedInstance
];
[
registrar
addMethodCallDelegate
:
instance
channel
:
channel
];
}
-
(
void
)
handleMethodCall
:(
FlutterMethodCall
*
)
call
result
:(
FlutterResult
)
result
{
if
([
@"getPlatformVersion"
isEqualToString
:
call
.
method
])
{
result
([
@"iOS "
stringByAppendingString
:[[
UIDevice
currentDevice
]
systemVersion
]]);
}
else
{
result
(
FlutterMethodNotImplemented
);
}
}
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLB2Platform
>
)
platform
onStart
:(
void
(
^
)(
id
<
FlutterBinaryMessenger
,
FlutterTextureRegistry
,
...
...
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FlutterBoostPlugin_private.h
View file @
6e0d8ada
...
...
@@ -37,9 +37,8 @@
-
(
FLBResultMediator
*
)
resultMediator
;
-
(
id
<
FLBAbstractFactory
>
)
factory
;
@property
(
nonatomic
,
strong
)
FlutterMethodChannel
*
methodChannel
;
@property
(
nonatomic
,
copy
)
NSString
*
fPageId
;
@property
(
nonatomic
,
copy
)
NSString
*
fPagename
;
@property
(
nonatomic
,
strong
)
NSDictionary
*
fParams
;
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_closePage.h
View file @
6e0d8ada
...
...
@@ -23,6 +23,7 @@
*/
// Generated by AIOCodeGen do not edit!
#import "FlutterServiceCallHandler.h"
@interface
NavigationService_closePage
:
FlutterServiceCallHandler
@end
\ No newline at end of file
#import "FLBMessageHandlerImp.h"
@interface
NavigationService_closePage
:
FLBMessageHandlerImp
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_closePage.mm
View file @
6e0d8ada
...
...
@@ -22,7 +22,6 @@
* THE SOFTWARE.
*/
//Generated by AIOCodeGen.
#import "ServiceGateway.h"
#import "NavigationService_closePage.h"
...
...
@@ -48,19 +47,19 @@
}
#pragma mark - Do not edit these method.
-
(
void
)
__flutter_p_handler_closePage
:(
NSDictionary
*
)
args
result
:(
void
(
^
)(
BOOL
))
result
{
[
self
onCall
:
result
uniqueId
:
args
[
@"uniqueId"
]
pageName
:
args
[
@"pageName"
]
params
:
args
[
@"params"
]
animated
:
args
[
@"animated"
]];
}
+
(
void
)
load
{
[[
ServiceGateway
sharedInstance
]
registerHandler
:[
NavigationService_closePage
new
]];
-
(
BOOL
)
call
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
BOOL
))
result
{
NSDictionary
*
args
=
msg
.
params
;
[
self
onCall
:
result
uniqueId:
args
[
@"uniqueId"
]
pageName:
args
[
@"pageName"
]
params:
args
[
@"params"
]
animated:
args
[
@"animated"
]];
}
-
(
NSString
*
)
returnType
{
return
@"BOOL"
;
}
-
(
NSString
*
)
service
{
return
@"NavigationService"
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_onFlutterPageResult.h
View file @
6e0d8ada
...
...
@@ -23,6 +23,6 @@
*/
// Generated by AIOCodeGen do not edit!
#import "FlutterServiceCallHandler.h"
@interface
NavigationService_onFlutterPageResult
:
FlutterServiceCallHandler
@end
\ No newline at end of file
#import "FLBMessageHandlerImp.h"
@interface
NavigationService_onFlutterPageResult
:
FLBMessageHandlerImp
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_onFlutterPageResult.mm
View file @
6e0d8ada
...
...
@@ -39,19 +39,15 @@
}
#pragma mark - Do not edit these method.
-
(
void
)
__flutter_p_handler_onFlutterPageResult
:(
NSDictionary
*
)
args
result
:(
void
(
^
)(
BOOL
))
result
{
-
(
BOOL
)
call
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
BOOL
))
result
{
NSDictionary
*
args
=
msg
.
params
;
[
self
onCall
:
result
uniqueId
:
args
[
@"uniqueId"
]
key
:
args
[
@"key"
]
resultData
:
args
[
@"resultData"
]
params
:
args
[
@"params"
]];
}
+
(
void
)
load
{
[[
ServiceGateway
sharedInstance
]
registerHandler
:[
NavigationService_onFlutterPageResult
new
]];
}
-
(
NSString
*
)
returnType
{
return
@"BOOL"
;
}
-
(
NSString
*
)
service
{
return
@"NavigationService"
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_onShownContainerChanged.h
View file @
6e0d8ada
...
...
@@ -23,6 +23,6 @@
*/
// Generated by AIOCodeGen do not edit!
#import "FlutterServiceCallHandler.h"
@interface
NavigationService_onShownContainerChanged
:
FlutterServiceCallHandler
@end
\ No newline at end of file
#import "FLBMessageHandlerImp.h"
@interface
NavigationService_onShownContainerChanged
:
FLBMessageHandlerImp
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_onShownContainerChanged.mm
View file @
6e0d8ada
...
...
@@ -38,19 +38,16 @@
}
#pragma mark - Do not edit these method.
-
(
void
)
__flutter_p_handler_onShownContainerChanged
:(
NSDictionary
*
)
args
result
:(
void
(
^
)(
BOOL
))
result
{
-
(
BOOL
)
call
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
BOOL
))
result
{
NSDictionary
*
args
=
msg
.
params
;
[
self
onCall
:
result
newName
:
args
[
@"newName"
]
oldName
:
args
[
@"oldName"
]
params
:
args
[
@"params"
]];
}
+
(
void
)
load
{
[[
ServiceGateway
sharedInstance
]
registerHandler
:[
NavigationService_onShownContainerChanged
new
]];
}
-
(
NSString
*
)
returnType
{
return
@"BOOL"
;
}
-
(
NSString
*
)
service
{
return
@"NavigationService"
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_openPage.h
View file @
6e0d8ada
...
...
@@ -23,6 +23,6 @@
*/
// Generated by AIOCodeGen do not edit!
#import "FlutterServiceCallHandler.h"
@interface
NavigationService_openPage
:
FlutterServiceCallHandler
@end
\ No newline at end of file
#import "FLBMessageHandlerImp.h"
@interface
NavigationService_openPage
:
FLBMessageHandlerImp
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_openPage.mm
View file @
6e0d8ada
...
...
@@ -44,19 +44,15 @@
}
#pragma mark - Do not edit these method.
-
(
void
)
__flutter_p_handler_openPage
:(
NSDictionary
*
)
args
result
:(
void
(
^
)(
BOOL
))
result
{
-
(
BOOL
)
call
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
BOOL
))
result
{
NSDictionary
*
args
=
msg
.
params
;
[
self
onCall
:
result
pageName
:
args
[
@"pageName"
]
params
:
args
[
@"params"
]
animated
:
args
[
@"animated"
]];
}
+
(
void
)
load
{
[[
ServiceGateway
sharedInstance
]
registerHandler
:[
NavigationService_openPage
new
]];
}
-
(
NSString
*
)
returnType
{
return
@"BOOL"
;
}
-
(
NSString
*
)
service
{
return
@"NavigationService"
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_pageOnStart.h
View file @
6e0d8ada
...
...
@@ -23,6 +23,6 @@
*/
// Generated by AIOCodeGen do not edit!
#import "F
lutterServiceCallHandler
.h"
@interface
NavigationService_pageOnStart
:
F
lutterServiceCallHandler
#import "F
LBMessageHandlerImp
.h"
@interface
NavigationService_pageOnStart
:
F
LBMessageHandlerImp
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/handlers/NavigationService_pageOnStart.mm
View file @
6e0d8ada
...
...
@@ -24,8 +24,8 @@
//Generated by AIOCodeGen.
#import "ServiceGateway.h"
#import "NavigationService_pageOnStart.h"
#import "ServiceGateway.h"
#import "NavigationService_pageOnStart.h"
#import "FlutterBoostPlugin_private.h"
@implementation
NavigationService_pageOnStart
...
...
@@ -40,19 +40,16 @@
}
#pragma mark - Do not edit these method.
-
(
void
)
__flutter_p_handler_pageOnStart
:(
NSDictionary
*
)
args
result
:(
void
(
^
)(
NSDictionary
*
))
result
{
[
self
onCall
:
result
params
:
args
[
@"params"
]];
}
+
(
void
)
load
{
[[
ServiceGateway
sharedInstance
]
registerHandler
:[
NavigationService_pageOnStart
new
]];
}
-
(
BOOL
)
call
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
NSDictionary
*
))
result
{
NSDictionary
*
args
=
msg
.
params
;
[
self
onCall
:
result
params
:
args
[
@"params"
]];
}
-
(
NSString
*
)
returnType
{
return
@"NSDictionary *"
;
}
-
(
NSString
*
)
service
{
return
@"NavigationService"
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/service/Service_NavigationService.h
View file @
6e0d8ada
...
...
@@ -22,11 +22,10 @@
* THE SOFTWARE.
*/
//Generated by AIOCodeGen do not edit!
#import "FlutterServiceTemplate.h"
#import <Foundation/Foundation.h>
@interface
Service_NavigationService
:
NSObject
+
(
FlutterServiceTemplate
*
)
service
;
+
(
void
)
onNativePageResult
:(
void
(
^
)(
NSNumber
*
))
result
uniqueId
:(
NSString
*
)
uniqueId
key
:(
NSString
*
)
key
resultData
:(
NSDictionary
*
)
resultData
params
:(
NSDictionary
*
)
params
;
+
(
void
)
didShowPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
+
(
void
)
willShowPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
...
...
@@ -34,4 +33,4 @@
+
(
void
)
didDisappearPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
+
(
void
)
didInitPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
+
(
void
)
willDeallocPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
@end
\ No newline at end of file
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/Generated/NavigationService/service/Service_NavigationService.mm
View file @
6e0d8ada
...
...
@@ -22,29 +22,18 @@
* THE SOFTWARE.
*/
//Generated by AIOCodeGen. Do not edit!
#import "Service_NavigationService.h"
#import "ServiceGateway.h"
#import "FlutterServiceTemplate.h"
#import "Service_NavigationService.h"
#import <Flutter/Flutter.h>
#import "FlutterBoostPlugin_private.h"
@implementation
Service_NavigationService
+
(
Flutter
ServiceTemplate
*
)
service
+
(
Flutter
MethodChannel
*
)
methodChannel
{
static
id
_instance
=
nil
;
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
_instance
=
[[
FlutterServiceTemplate
alloc
]
initWithName
:
@"NavigationService"
];
});
return
_instance
;
}
+
(
void
)
load
{
[[
ServiceGateway
sharedInstance
]
addService
:[
self
service
]];
return
FlutterBoostPlugin
.
sharedInstance
.
methodChannel
;
}
+
(
void
)
onNativePageResult
:(
void
(
^
)(
NSNumber
*
))
result
uniqueId
:(
NSString
*
)
uniqueId
key
:(
NSString
*
)
key
resultData
:(
NSDictionary
*
)
resultData
params
:(
NSDictionary
*
)
params
{
NSMutableDictionary
*
tmp
=
[
NSMutableDictionary
dictionary
];
...
...
@@ -52,7 +41,7 @@
if
(
key
)
tmp
[
@"key"
]
=
key
;
if
(
resultData
)
tmp
[
@"resultData"
]
=
resultData
;
if
(
params
)
tmp
[
@"params"
]
=
params
;
[
self
.
service
invoke
:
@"onNativePageResult"
arg
s
:
tmp
result
:^
(
id
tTesult
)
{
[
self
.
methodChannel
invokeMethod
:
@"onNativePageResult"
argument
s
:
tmp
result
:^
(
id
tTesult
)
{
if
(
result
)
{
result
(
tTesult
);
}
...
...
@@ -65,7 +54,7 @@
if
(
pageName
)
tmp
[
@"pageName"
]
=
pageName
;
if
(
params
)
tmp
[
@"params"
]
=
params
;
if
(
uniqueId
)
tmp
[
@"uniqueId"
]
=
uniqueId
;
[
self
.
service
invoke
:
@"didShowPageContainer"
arg
s
:
tmp
result
:^
(
id
tTesult
)
{
[
self
.
methodChannel
invokeMethod
:
@"didShowPageContainer"
argument
s
:
tmp
result
:^
(
id
tTesult
)
{
if
(
result
)
{
result
(
tTesult
);
}
...
...
@@ -78,7 +67,7 @@
if
(
pageName
)
tmp
[
@"pageName"
]
=
pageName
;
if
(
params
)
tmp
[
@"params"
]
=
params
;
if
(
uniqueId
)
tmp
[
@"uniqueId"
]
=
uniqueId
;
[
self
.
service
invoke
:
@"willShowPageContainer"
arg
s
:
tmp
result
:^
(
id
tTesult
)
{
[
self
.
methodChannel
invokeMethod
:
@"willShowPageContainer"
argument
s
:
tmp
result
:^
(
id
tTesult
)
{
if
(
result
)
{
result
(
tTesult
);
}
...
...
@@ -91,7 +80,7 @@
if
(
pageName
)
tmp
[
@"pageName"
]
=
pageName
;
if
(
params
)
tmp
[
@"params"
]
=
params
;
if
(
uniqueId
)
tmp
[
@"uniqueId"
]
=
uniqueId
;
[
self
.
service
invoke
:
@"willDisappearPageContainer"
arg
s
:
tmp
result
:^
(
id
tTesult
)
{
[
self
.
methodChannel
invokeMethod
:
@"willDisappearPageContainer"
argument
s
:
tmp
result
:^
(
id
tTesult
)
{
if
(
result
)
{
result
(
tTesult
);
}
...
...
@@ -104,7 +93,7 @@
if
(
pageName
)
tmp
[
@"pageName"
]
=
pageName
;
if
(
params
)
tmp
[
@"params"
]
=
params
;
if
(
uniqueId
)
tmp
[
@"uniqueId"
]
=
uniqueId
;
[
self
.
service
invoke
:
@"didDisappearPageContainer"
arg
s
:
tmp
result
:^
(
id
tTesult
)
{
[
self
.
methodChannel
invokeMethod
:
@"didDisappearPageContainer"
argument
s
:
tmp
result
:^
(
id
tTesult
)
{
if
(
result
)
{
result
(
tTesult
);
}
...
...
@@ -117,7 +106,7 @@
if
(
pageName
)
tmp
[
@"pageName"
]
=
pageName
;
if
(
params
)
tmp
[
@"params"
]
=
params
;
if
(
uniqueId
)
tmp
[
@"uniqueId"
]
=
uniqueId
;
[
self
.
service
invoke
:
@"didInitPageContainer"
arg
s
:
tmp
result
:^
(
id
tTesult
)
{
[
self
.
methodChannel
invokeMethod
:
@"didInitPageContainer"
argument
s
:
tmp
result
:^
(
id
tTesult
)
{
if
(
result
)
{
result
(
tTesult
);
}
...
...
@@ -130,7 +119,7 @@
if
(
pageName
)
tmp
[
@"pageName"
]
=
pageName
;
if
(
params
)
tmp
[
@"params"
]
=
params
;
if
(
uniqueId
)
tmp
[
@"uniqueId"
]
=
uniqueId
;
[
self
.
service
invoke
:
@"willDeallocPageContainer"
arg
s
:
tmp
result
:^
(
id
tTesult
)
{
[
self
.
methodChannel
invokeMethod
:
@"willDeallocPageContainer"
argument
s
:
tmp
result
:^
(
id
tTesult
)
{
if
(
result
)
{
result
(
tTesult
);
}
...
...
@@ -138,4 +127,4 @@
}
@end
\ No newline at end of file
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/base/FLBMessageDispather.h
0 → 100755
View file @
6e0d8ada
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#import <Foundation/Foundation.h>
#import "FLBMessageing.h"
@interface
FLBMessageDispather
:
NSObject
<
FLBMessageDispatcher
>
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/base/FLBMessageDispather.m
0 → 100755
View file @
6e0d8ada
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#import "FLBMessageDispather.h"
@interface
FLBMessageDispather
()
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
handlerMap
;
@end
@implementation
FLBMessageDispather
-
(
instancetype
)
init
{
if
(
self
=
[
super
init
])
{
_handlerMap
=
NSMutableDictionary
.
new
;
}
return
self
;
}
-
(
BOOL
)
dispatch
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
id
date
))
result
{
if
(
msg
)
{
id
<
FLBMessageHandler
>
handler
=
_handlerMap
[
msg
.
name
];
return
[
handler
handle
:
msg
result
:
result
];
}
else
{
return
NO
;
}
}
-
(
void
)
registerHandler
:(
id
<
FLBMessageHandler
>
)
handler
{
if
(
!
handler
)
return
;
NSArray
*
methods
=
handler
.
handledMessageNames
;
for
(
NSString
*
name
in
methods
){
if
(
_handlerMap
[
name
]){
NSAssert
(
NO
,
@"Conflicted method call name results in undefined error!"
);
}
else
{
_handlerMap
[
name
]
=
handler
;
}
}
}
-
(
void
)
removeHandler
:(
id
<
FLBMessageHandler
>
)
handler
{
NSArray
*
methods
=
handler
.
handledMessageNames
;
[
_handlerMap
removeObjectsForKeys
:
methods
];
}
-
(
void
)
removeAll
{
[
_handlerMap
removeAllObjects
];
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/base/FLBMessageHandlerImp.h
0 → 100755
View file @
6e0d8ada
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#import <Foundation/Foundation.h>
#import "FLBMessageing.h"
@interface
FLBMessageHandlerImp
:
NSObject
<
FLBMessageHandler
>
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/base/FLBMessageHandlerImp.m
0 → 100755
View file @
6e0d8ada
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#import "FLBMessageHandlerImp.h"
typedef
void
(
^
SendResult
)(
NSObject
*
result
);
@interface
FLBMessageHandlerImp
()
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
callHandlers
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
methodNames
;
@end
@implementation
FLBMessageHandlerImp
-
(
instancetype
)
init
{
if
(
self
=
[
super
init
])
{
_callHandlers
=
[
NSMutableDictionary
new
];
_methodNames
=
NSMutableArray
.
new
;
[
self
bindCallMethod
];
}
return
self
;
}
#pragma mark - method handling logic.
//Farward this msg to old entry.
-
(
BOOL
)
handle
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
id
data
))
result
{
return
[
self
handleMethodCall
:
msg
.
name
args
:
msg
.
params
result
:
result
];
}
-
(
NSArray
*
)
handledMessageNames
{
return
_methodNames
;
}
-
(
bool
)
handleMethodCall
:(
NSString
*
)
call
args
:(
NSDictionary
*
)
args
result
:(
void
(
^
)(
id
data
))
result
{
void
(
^
handler
)(
NSDictionary
*
,
SendResult
)
=
[
self
findHandler
:
call
];
if
(
handler
)
{
handler
(
args
,
result
);
return
YES
;
}
return
NO
;
}
-
(
id
)
findHandler
:(
NSString
*
)
call
{
return
_callHandlers
[
call
];
}
-
(
void
)
bindCallMethod
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
SEL
method
=
@selector
(
call
:
result
:
);
if
(
_callHandlers
[
NSStringFromSelector
(
method
)])
{
return
;
}
__weak
typeof
(
self
)
weakSelf
=
self
;
_callHandlers
[
NSStringFromSelector
(
method
)]
=
^
(
NSDictionary
*
args
,
SendResult
result
){
id
resultBlock
=
[
weakSelf
getHandlerBlockForType
:
weakSelf
.
returnType
result
:
result
];
if
(
resultBlock
&&
result
)
{
[
weakSelf
performSelector
:
method
withObject
:
args
withObject
:
resultBlock
];
}
else
{
#if DEBUG
[
NSException
raise
:
@"invalid call"
format
:
@"missing handler and result!"
];
#endif
}
};
#pragma clang diagnostic pop
}
-
(
id
)
getHandlerBlockForType
:(
NSString
*
)
type
result
:(
SendResult
)
result
{
if
([
type
isEqual
:
@"int64_t"
])
{
return
^
(
int64_t
value
){
result
(
@
(
value
));
};
}
if
([
type
isEqual
:
@"double"
])
{
return
^
(
double
value
){
result
(
@
(
value
));
};
}
if
([
type
isEqual
:
@"BOOL"
])
{
return
^
(
BOOL
value
){
result
(
@
(
value
));
};
}
if
([
type
hasPrefix
:
@"NSString"
])
{
return
^
(
NSString
*
value
){
if
([
value
isKindOfClass
:
NSNumber
.
class
])
{
#if DEBUG
[
NSException
raise
:
@"invalid type"
format
:
@"require NSString!"
];
#endif
value
=
((
NSNumber
*
)
value
).
stringValue
;
}
result
(
value
);
};
}
if
([
type
hasPrefix
:
@"NSArray"
])
{
return
^
(
NSArray
*
value
){
result
(
value
);
};
}
if
([
type
hasPrefix
:
@"NSDictionary"
])
{
return
^
(
NSDictionary
*
value
){
result
(
value
);
};
}
if
([
type
isEqual
:
@"id"
])
{
return
result
;
}
/*
@"int":@"int64_t",
@"double":@"double",
@"bool":@"BOOL",
@"String":@"NSString *",
*/
return
nil
;
}
-
(
NSString
*
)
returnType
{
return
@"id"
;
}
-
(
NSString
*
)
service
{
return
@"root"
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/base/FLBMessageImp.h
0 → 100644
View file @
6e0d8ada
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#import <Foundation/Foundation.h>
#import "FLBMessageing.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FLBMessageImp
:
NSObject
<
FLBMessage
>
@property
(
nonatomic
,
copy
)
NSString
*
name
;
@property
(
nonatomic
,
strong
)
NSDictionary
*
params
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/base/FLBMessageImp.m
0 → 100644
View file @
6e0d8ada
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#import "FLBMessageImp.h"
@implementation
FLBMessageImp
-
(
NSString
*
)
name
{
return
_name
;
}
-
(
NSDictionary
*
)
params
{
return
_params
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Messaging/base/FLBMessageing.h
0 → 100755
View file @
6e0d8ada
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#import <Foundation/Foundation.h>
@protocol
FLBMessage
<
NSObject
>
@required
-
(
NSString
*
)
name
;
-
(
NSDictionary
*
)
params
;
@end
@protocol
FLBMessageHandler
<
NSObject
>
@required
-
(
BOOL
)
handle
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
id
result
))
result
;
-
(
NSArray
*
)
handledMessageNames
;
-
(
NSString
*
)
service
;
@end
@protocol
FLBMessageDispatcher
<
NSObject
>
@required
-
(
BOOL
)
dispatch
:(
id
<
FLBMessage
>
)
msg
result
:(
void
(
^
)(
id
result
))
result
;
-
(
void
)
registerHandler
:(
id
<
FLBMessageHandler
>
)
handler
;
-
(
void
)
removeHandler
:(
id
<
FLBMessageHandler
>
)
handler
;
-
(
void
)
removeAll
;
@end
This diff is collapsed.
Click to expand it.
ios/flutter_boost.podspec
View file @
6e0d8ada
...
...
@@ -25,8 +25,6 @@ A new Flutter plugin make flutter better to use!
'Classes/1.5/FLB2FlutterViewContainer.h'
s
.
dependency
'Flutter'
s
.
dependency
'xservice_kit'
s
.
libraries
=
'c++'
s
.
ios
.
deployment_target
=
'8.0'
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment