This commit is contained in:
2020-08-28 09:51:37 +08:00
parent 3ece010fc1
commit 6b82fd5419
69 changed files with 1255 additions and 1024 deletions

View File

@@ -6,7 +6,8 @@
#import <CoreTelephony/CTCall.h>
@interface CallListner : NSObject
@property (assign, nonatomic)NSString *unityListner;
@property (assign, nonatomic)NSString *unityListner;
@property (assign, nonatomic)BOOL *isComingCall;
@property(nonatomic, strong) CTCallCenter* callCenter;
@end
#endif

View File

@@ -27,34 +27,33 @@ - (id)init:(NSString *)listner
}
- (void)initCallCenter {
bool *isComingCall = false;
_callCenter = [[CTCallCenter alloc] init];
_callCenter.callEventHandler = ^(CTCall* call) {
dispatch_async(dispatch_get_main_queue(), ^{
if ([call.callState isEqualToString:CTCallStateDisconnected]) {
// NSLog("CTCallCenter:Call has been disconnected");
NSLog(@"电话挂断");
if(isComingCall) {
[self sendUnityMessage:@"onEndincomeCall", ""]
if(_isComingCall) {
[self sendUnityMessage:@"onEndincomeCall" with:@""];
} else {
[self sendUnityMessage:@"onEndOutGoingCall", ""]
[self sendUnityMessage:@"onEndOutGoingCall" with:@""];
}
} else if ([call.callState isEqualToString:CTCallStateConnected]) {
// NSLog("CTCallCenter:Callhasjustbeen connected");
NSLog(@"电话接通");
if(isComingCall) {
[self sendUnityMessage:@"onConectedComingCall", ""]
if(_isComingCall) {
[self sendUnityMessage:@"onConectedComingCall" with:@""];
} else {
[self sendUnityMessage:@"onConectedOutGoingCall", ""]
[self sendUnityMessage:@"onConectedOutGoingCall" with:@""];
}
} else if ([call.callState isEqualToString:CTCallStateIncoming]) {
// NSLog("CTCallCenter:Call is incoming");
NSLog(@"电话被叫");
isComingCall = true;
_isComingCall = true;
} else if ([call.callState isEqualToString:CTCallStateDialing]) {
// NSLog("CTCallCenter:Call is Dialing");
NSLog(@"电话主动拨打电话");
isComingCall = false;
_isComingCall = false;
} else {
// NSLog("CTCallCenter:Nothing is done");
NSLog(@"电话其他状态");
@@ -76,12 +75,12 @@ -(void) sendUnityMessage:(const NSString*)method with:(NSString*)msg
#if __cplusplus
extern "C" {
#endif
void _init(const char* goName);
void _initCallListner(const char* goName);
#if __cplusplus
}
#endif
void _init(const char* goName) {
void _initCallListner(const char* goName) {
[[CallListner instance] init:[NSString stringWithUTF8String:goName]];
}

View File

@@ -31,7 +31,8 @@ public class MyAudioPlayerByUrl : MonoBehaviour
#if UNITY_EDITOR
//You should have a fallback to normal AudioSource playing in your game so you can also hear sounds while developing.
Debug.Log("Please try this in a real device!");
#else
return;
#elif UNITY_ANDROID
if (bufferSize <= 0)
{
DeviceAudioInformation deviceAudioInformation = NativeAudio.GetDeviceAudioInformation();

View File

@@ -29,7 +29,7 @@ public class CallListner : CLBehaviour4Lua
#if UNITY_IOS
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _init(string goName);
private static extern void _initCallListner(string goName);
#endif
public void init()
@@ -38,7 +38,7 @@ public class CallListner : CLBehaviour4Lua
#if UNITY_ANDROID
plugin.Call("init", gameObject.name);
#elif UNITY_IOS
_init(gameObject.name);
_initCallListner(gameObject.name);
#endif
}

View File

@@ -1 +0,0 @@
{"2020158":{"2":{"id":"2", "host":"47.111.20.34", "name":"\u6d4b\u8bd5\u670d\u52a1\u5668", "iosVer":"49a8c514f675dc39ba88795e36da4ce3", "port":29004, "androidVer":"e693880b58a37eb3ccbcd28f8171757c", "isDev":1}, "3":{"id":"3", "host":"192.168.1.11", "name":"\u672c\u5730\u6d4b\u8bd5", "iosVer":"49a8c514f675dc39ba88795e36da4ce3", "port":29000, "androidVer":"4f33d26a37d983936fa5feebfe6b57f8", "isDev":1}, "1":{"id":"1", "host":"app.ttf-cti.com", "name":"\u6b63\u5f0f\u670d\u52a1\u5668", "iosVer":"49a8c514f675dc39ba88795e36da4ce3", "port":29000, "androidVer":"4f33d26a37d983936fa5feebfe6b57f8", "isDev":0}}}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 12d49a1a05449429383d2dd5bc950c04
guid: b08f362d2c404428a8adc7ed5dd1a8a4
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4414031f07da64220af395c88187fce2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1d17a6a7c149c4434a1f96a9f8958c26
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d942daeeebc644331907af146c9afa9d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bd796bfa260094dcdbd57ead3624430a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7ce378d233e5d49a8badb79f2d15d144
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 370886fbbc6ff4835a0febd857e76b0b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e30d989fa6ac9470e9b7ff1a9a8ad198
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9457d855103d34bef903cef56ee3f845
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8c5cc917df7af49e7b7c87eb76e542d7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bdc37160f7209485bba8ac319ef0cc43
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b3a8bd59560ef4be78fbdad3b3ce2104
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2ef56a8166d6742c5a7d546c0895d24a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 95301f42c8aa7431abcfde22019348ee
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e632b854f350942fca7570e450a9ca97
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f0ce006ba2c8941d18f78d90dae51f5c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 40ecde913d3ee418e9e84471a55e85e7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 15b386d0bcb6c480fb0f0bb00a6afca7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 870779b669b3548ba85b144c4a7ac669
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 18899c16b4f4944e5bd29b977bfecf3d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f173a5566e7bf463989aefeb8d7f1f78
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1 +1 @@
r8 $trCRM/resVer/IOS/VerCtl/priority.ver8,54eb4375556c788d7f02889e28260d908 !trCRM/resVer/IOS/VerCtl/other.ver8,62728fec0546980ac4d5f4ec9806a711
r8 $trCRM/resVer/IOS/VerCtl/priority.ver8,239ad8ca9088eb93580025838168dcd18 !trCRM/resVer/IOS/VerCtl/other.ver8,e1ba4f801e757dd7ee600a7b4ccffc0b