Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Is anyone adding Sign in with Apple to their app?

Discussion in 'iOS and tvOS' started by andymads, Feb 13, 2020.

  1. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    How are you drawing the button? Have you made your own?

    Unity's package contains a single small black button image with an icon and english text.

    I need a bigger button with localised text. It's not clear to me what's actually allowed.

    Do I just translate 'Sign in with Apple', or do Apple have specific strings that must be used? If so, where do I find them?

    In terms of the font, it seems that it's called San Francisco, but the license states that it is solely to be used for creating mock-ups. So, can I use any font I choose that suits my game?

    THE APPLE SAN FRANCISCO FONT IS TO BE USED SOLELY FOR CREATING MOCK-UPS OF USER INTERFACES TO BE USED IN SOFTWARE PRODUCTS RUNNING ON APPLE’S iOS, OS X OR tvOS OPERATING SYSTEMS, AS APPLICABLE.
     
  2. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
  3. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Thanks for replying.

    Have you got a link to the guideline you refer to?

    You say the system font, but according to this there are many system fonts that can be used in an app's UI. If you are referring to one particular font, what's it called? When I list the fonts on an iOS device I don't see anything called 'system' or similar.
     
  4. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
  5. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Thanks. I do appreciate that you're trying to help.

    That link was very useful. The only thing I'm not sure about is font size. With a 44pt button (88px @2x) they say the font size should be 19pt - but that is tiny in Unity.
     
    Last edited: Feb 24, 2020
  6. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Just want to add that my app has now passed Apple submission.

    Here's a screenshot to show what the Sign in with Apple button looks like.

    IMG_1203.PNG
     
    Neonlyte likes this.
  7. Danny_What

    Danny_What

    Joined:
    Mar 5, 2019
    Posts:
    1
    Hey all,

    I got great help from your discussion. So, I want to contribute bit even though you already figured out.
    I got help from Unity and they advised to find the iOS Default System Font. It is involved to program Object-c. All thanks go to them.

    Code (CSharp):
    1. // Place it in Plugin/IOS/some.mm
    2. // Of course you need define it in some.h, too.
    3. char* GetDefaultSystemFontImpl()
    4. {
    5.     UIFont *font = [UIFont systemFontOfSize:10];
    6.     NSString *fontName = font.fontName;
    7.     NSLog(@"SYSTEM_FONT_INFO: %@", fontName);
    8.     return strdup([fontName UTF8String]);
    9. }
    10.  
    Code (CSharp):
    1. // From C# for Unity
    2.  
    3. #if UNITY_IOS
    4.     [DllImport("__Internal")]
    5.     private static extern string GetDefaultSystemFontImpl();
    6. #endif
    7.  
    8.     private const int SIZE_OS_FONT = 32;
    9.     [SerializeField]
    10.     private string _defaultFontName = "Helvetica";
    11. ......
    12.     // Start is called before the first frame update
    13.     void Start()
    14.     {
    15.         if (_osFont == null)
    16.         {
    17. #if UNITY_EDITOR && UNITY_IOS
    18.             _osFont = Font.CreateDynamicFontFromOSFont(_defaultFontName, SIZE_OS_FONT);
    19. #elif UNITY_IOS
    20.             _defaultFontName = GetDefaultSystemFontImpl();
    21.             _osFont = Font.CreateDynamicFontFromOSFont(_defaultFontName, SIZE_OS_FONT);
    22. #endif
     
    Neonlyte likes this.