this is my first attempt with implementation native module for get device id
using Uno;
using Uno.Collections;
using Fuse.Scripting;
using Fuse;
using Uno.Compiler.ExportTargetInterop;
public class UIDevice : NativeModule
{
public UIDevice()
{ AddMember( new NativeFunction("getDeviceID", (NativeCallback)GetDeviceID) );
}
object GetDeviceID(Context c, object[] args)
{
return getDeviceID();
}
[Foreign(Language.ObjC)]
extern(iOS) public string getDeviceID ()
@{
NSString* Identifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
return Identifier;
@}
[Foreign(Language.Java)]
static extern(Android) string getDeviceID()
@{
TelephonyManager manager=(TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String uuid = manager.getDeviceId();
return uuid;
@}
static extern(!(iOS||Android)) string getDeviceID()
{
return "0123456789";
}
}
… but after compilation for iOS throws me this error
plz. has anybody some idea, how can i fix it ?