Search Unity

[UWP] Plugins from .NET backend to IL2CPP

Discussion in 'Windows' started by MartinLaursen, Apr 20, 2016.

  1. MartinLaursen

    MartinLaursen

    Joined:
    Jun 11, 2015
    Posts:
    5
    Hello everyone,

    I currently have a project running Universal 10 built with the .NET scripting backend. Now I want to port the project to use IL2CPP, but my plugins will not compile. I am using plugins for logging in to Facebook and doing In App Purchases, but none of these will compile when switching to IL2CPP.

    Quoting the Unity manual:

    Unlike .NET scripting backend, IL2CPP scripting backend does not support managed plugins targeting .NET 4.5 or any of Windows Runtime APIs. All managed plugins must be targeting .NET 3.5 or equivalent API.

    Would this mean that there currently is no way of using Windows Phone 10 API when building apps to compile with IL2CPP? If correct, how are we supposed to implement In App Purchases? Or simple stuff like getting the battery percentage of the phone?

    Any help/input much appreciated.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    That is correct today: you cannot use Windows 10 APIs from C# with IL2CPP. We're working on it as we speak, but we don't have an ETA to share.

    The only way to use windows APIs on IL2CPP scripting backend is to pinvoke into native code (C++) and call those APIs from there. Since they're all native OS APIs, calling them from C++ is possible.
     
  3. MartinLaursen

    MartinLaursen

    Joined:
    Jun 11, 2015
    Posts:
    5
    Damn, alright. But thank you for the quick response, I'll keep my eyes and ears open, since I would prefer to not rewrite all of our plugins as C++ when we have them as managed DLL's already.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Yeah, switching from .NET to IL2CPP scripting backend scenario is far from ideal right now. Although we will deprecate .NET scripting backend in favour of IL2CPP in the future, that will not happen before IL2CPP supports everything .NET does and more.
     
  5. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    @Tautvydas-Zilys Still there no way to make it compatible directly if we have plugins in .net?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Actually that changed! We finished our work on this and since 5.6 (released in March), IL2CPP should support all plugins that were compatible with .NET scripting backend. Just make sure to switch to ".NET 4.6 API Compatiblity Level" in player settings.
     
  7. ArjunKPrahaladan

    ArjunKPrahaladan

    Joined:
    May 17, 2017
    Posts:
    13
    I have a more specific request. Does anybody know of any webview plugins that support UWP in IL2CPP. I need to port my project running in iOS to UWP. But I one of the core plugins I use only supports IL2CPP.
     
  8. MuhammadHaseeb56

    MuhammadHaseeb56

    Joined:
    Mar 12, 2019
    Posts:
    13
    i want to implement ads in my uwp project with il2cpp build before that i was implement the ads in .net backend scripting but now i dont know hoe to implements ads in the il2cpp build kindly guide me how i can implement the ads in il2cpp build