2022-09-16 10:07:57 -06:00
|
|
|
'''
|
|
|
|
IOS Call
|
|
|
|
----------
|
|
|
|
'''
|
|
|
|
|
2024-06-02 10:31:58 -06:00
|
|
|
from sbapp.plyer.facades import Call
|
2022-09-16 10:07:57 -06:00
|
|
|
from pyobjus import autoclass, objc_str
|
|
|
|
|
|
|
|
NSURL = autoclass('NSURL')
|
|
|
|
NSString = autoclass('NSString')
|
|
|
|
UIApplication = autoclass('UIApplication')
|
|
|
|
|
|
|
|
|
|
|
|
class IOSCall(Call):
|
|
|
|
|
|
|
|
def _makecall(self, **kwargs):
|
|
|
|
tel = kwargs.get('tel')
|
|
|
|
url = "tel://" + tel
|
|
|
|
nsurl = NSURL.alloc().initWithString_(objc_str(url))
|
|
|
|
|
|
|
|
UIApplication.sharedApplication().openURL_(nsurl)
|
|
|
|
|
|
|
|
def _dialcall(self, **kwargs):
|
|
|
|
pass
|
|
|
|
# Not possible, Access not provided by iPhone SDK
|
|
|
|
|
|
|
|
|
|
|
|
def instance():
|
|
|
|
return IOSCall()
|