Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Is there a way to get the iOS App Transaction info from an app in Unity?

Discussion in 'iOS and tvOS' started by petey, Sep 24, 2023.

  1. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,827
  2. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    548
    You would need to create your native plugin to pipe this info in. You can do this by adding native scripts to the Plugins folder: https://docs.unity3d.com/Manual/PluginsForIOS.html

    I've done this by adding a swift script which access the AppTransaction api. I have a objective c/c++ hybrid script (ie. has .mm file extension allowing both C and Obj C to be in the one script), which has marshalled methods to bridge between C# and the native side. The objc script talks to the swift script and passes values back. I don't know if there's a way to marshall methods straight to Swift or not. There's a lot of steps to get this going, but it's doable.
     
  3. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,827
    Okay thanks! Good to know.