如果他们在手机上,我的应用程序的某些部分最好向用户突出显示.
是否有电话要检查我们是否正在打电话?不幸的是,出于显而易见的原因,在"API"文档中检查"call"是一个可怕的词.
我正在开发一个IOS应用程序.我的要求是获取移动运营商名称.我使用了以下代码.
在.h
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
Run Code Online (Sandbox Code Playgroud)
在.m
CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [netinfo subscriberCellularProvider];
NSLog(@"Carrier Name: %@", [carrier carrierName]);
Here in Log its printing "Carrier"
Run Code Online (Sandbox Code Playgroud)
我用Google搜索并找到了这个链接.但是根据它的回答,我的设备仍然没有处于飞机模式,并且SIM卡存在于里面.如果任何人工作,请帮助我.它耗尽了我的时间.谢谢你提前
我已经阅读了关于进行非voip调用的问题,似乎开放式网址是唯一的方法.由于不推荐使用CoreTelephony,是否可以在使用open url进行调用时使用Callkit来获取调用状态?如果没有,有没有办法以编程方式获得呼叫状态?我正在开发一个内部应用程序.
提前致谢!!
我需要获得有关最近的手机信号塔(类似于手机信号)的信息.例如,通过列出可能的单元格来识别不耗电的地方.
我查看了coretelephony框架,但没有看到任何关于蜂窝塔的信息.有没有其他方式来访问它?或者这只能通过私有API调用吗?
我想检索一些蜂窝网络信息,例如 cellId 和 LAC。我知道没有官方方法可以做到这一点,但我仍然遇到一些 CoreTelephony 例程,例如 CTServerConnectionGetCellID。
有运气让这个工作吗?
有什么帮助吗?
我需要获得MCC与MNC当前的国家(而不是从类CTCarrier的SIM本国)代码.
我使用私有API CoreTelephony.framework.在我的设备上一切正常.但是在CellMonitorCallback我们获得的方法中的其他设备上cells = NULL.
可能有人可以帮我做错了吗?
#import "AMCoreTelephone.h"
#import <CoreTelephony/CTCarrier.h>
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
struct CTResult
{
int flag;
int a;
};
extern CFStringRef const kCTCellMonitorCellType;
extern CFStringRef const kCTCellMonitorCellTypeServing;
extern CFStringRef const kCTCellMonitorCellTypeNeighbor;
extern CFStringRef const kCTCellMonitorCellId;
extern CFStringRef const kCTCellMonitorLAC;
extern CFStringRef const kCTCellMonitorMCC;
extern CFStringRef const kCTCellMonitorMNC;
extern CFStringRef const kCTCellMonitorUpdateNotification;
id _CTServerConnectionCreate(CFAllocatorRef, void*, int*);
void _CTServerConnectionAddToRunLoop(id, CFRunLoopRef, CFStringRef);
mach_port_t _CTServerConnectionGetPort(id);
#ifdef __LP64__
void _CTServerConnectionRegisterCallService(id);
void _CTServerConnectionUnregisterCallService(id,int*);
void _CTServerConnectionRegisterForNotification(id, CFStringRef); …Run Code Online (Sandbox Code Playgroud) 这种崩溃只发生在生产中
Crashed Thread
0
libobjc.A.dylib 0x000000019843fbd0 objc_msgSend + 16
1
CoreTelephony 0x00000001886bac5c _ZL25_ServerConnectionCallbackP20__CTServerConnectionPK10__CFStringPK14__CFDictionaryPv + 48
2
CoreTelephony 0x00000001886d1030 ___ZNK13CTServerState21sendNotification_syncE7CTEventPK10__CFStringPK14__CFDictionary_block_invoke14 + 28
3
libdispatch.dylib 0x0000000198a713ac _dispatch_call_block_and_release + 20
4
libdispatch.dylib 0x0000000198a7136c _dispatch_client_callout + 12
5
libdispatch.dylib 0x0000000198a7b4c0 _dispatch_queue_drain + 1212
6
libdispatch.dylib 0x0000000198a74474 _dispatch_queue_invoke + 128
7
libdispatch.dylib 0x0000000198a7d224 _dispatch_root_queue_drain + 660
8
libdispatch.dylib 0x0000000198a7e75c _dispatch_worker_thread3 + 104
9
libsystem_pthread.dylib 0x0000000198c4d2e4 _pthread_wqthread + 812
10
libsystem_pthread.dylib 0x0000000198c4cfa8 start_wqthread + 0
Run Code Online (Sandbox Code Playgroud)
这个也是
Crashed Thread
0
libobjc.A.dylib 0x306e1f46 objc_msgSend + 6
1
CoreTelephony …Run Code Online (Sandbox Code Playgroud) 我想在Swift中使用subscriberCellularProviderDidUpdateNotifier,但我不知道如何以及在何处放置它.
有任何想法吗?我已经搜索过了,但只有Objective-C样本可用.
我每天收到大约 5,000 个报告的问题,原因是“收到没有通知名称的通知”。
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException' reason: 'Received a notification with no notification name'
Last Exception Backtrace:
0 CoreFoundation 0x000000018206e950 __exceptionPreprocess + 132
1 libobjc.A.dylib 0x000000018e5741fc objc_exception_throw + 60
2 CoreFoundation 0x000000018206e810 +[NSException raise:format:arguments:] + 116
3 Foundation 0x0000000182ba6db4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4 CoreTelephony 0x00000001827ca39c -[CTTelephonyNetworkInfo handleNotificationFromConnection:ofType:withInfo:] + 272
5 CoreTelephony 0x00000001827c9784 _ServerConnectionCallback(__CTServerConnection*, __CFString const*, __CFDictionary const*, void*) + 152
6 CoreTelephony 0x00000001827de958 ___ZNK13CTServerState21sendNotification_syncE7CTEventPK10__CFStringPK14__CFDictionary_block_invoke15 + 32
7 libdispatch.dylib 0x000000018eb4c014 _dispatch_call_block_and_release + …Run Code Online (Sandbox Code Playgroud) 我希望在我的应用中获得电话状态.
经过一番搜索,我找到了CoreTelephony框架.但是在iOS 10中已经弃用了.那么还有其他可用选择吗?
我也找到了CallKit.iOS 10中的一个新框架.但是没有得到与我搜索时相同的呼叫状态.
core-telephony ×10
ios ×9
iphone ×5
callkit ×2
objective-c ×2
swift ×2
crash ×1
ios10 ×1
private ×1
reachability ×1
sdk ×1