1

I started working on a project that was built using OneSignal v1.15.2.

On Android everything works fine. On iOS instead, I tried to follow this: https://documentation.onesignal.com/v3.0/docs/unity-sdk-setup (points [5.1 - 5.7]: they just add UserNotifications.framework)

Now, if I launch my application it crashes and the message is: "dyld: image not found". If I remove UserNotifications.framework the all game runs ok but notifications.

Is the current version of OneSignal so different from the past? Is there another setup process guide that I should follow?

I'm using Unity 5.3.1p4 and XCode 8.2.1 (I was using XCode 8.3.1 and notifications worked well, but this newer version have some documented incompatibility with Unity 5.3.1p4).

Can anyone help me?

Thank you.

Best regard, Andrea.

erre
  • 39
  • 2
  • 6
  • Check this link. http://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta/28469804#28469804 – Ognjen Marceta May 04 '17 at 08:40
  • @OgnjenMarceta, unfortunately it doesn't seem work for me. When I create XCode project, Unity automatically import some .framework files, but does not include UserNotifications.framework. And it sounds strange to me that the OneSignal official guide say something that doesn't work. I'm wondering if there is a older guide that was used with v1.15.2. – erre May 04 '17 at 09:54

1 Answers1

1

For what it's worth I'm using Unity 5.6.0 and Xcode 8.3.2 with the SDK Unity5OneSignalSDK.unitypackage and points 5.1 through 5.7 where sufficient to get push notifications working.

I am also automating the background modes to check "remote-notifications" using the following post processor ... I can't find a way to automate the link with UserNotifications.framework yet tho ... let me know if anybody has ideas on how to do that.

// ---------------------------------------------------------------------------------------------------------------------
public static class XCodePostProcess
{

    // -----------------------------------------------------------------------------------------------------------------
    [PostProcessBuild(100)]
    public static void OnPostprocessBuild( BuildTarget target, string pathToBuildProject )
    {
        if (target == BuildTarget.iOS)
        {
            UpdateInfoPlist( pathToBuildProject );
        }
    }

    // -----------------------------------------------------------------------------------------------------------------
    private static void UpdateInfoPlist( string path )
    {

        // load plist
        string plistPath = Path.Combine( path, "Info.plist" );
        PlistDocument plist = new PlistDocument();
        plist.ReadFromString( File.ReadAllText( plistPath ) );

        //Get Root
        PlistElementDict rootDict = plist.root;

        //Add Necessary Things
        PlistElementArray LSApplicationQueriesSchemes = rootDict.CreateArray( "LSApplicationQueriesSchemes" );
        LSApplicationQueriesSchemes.AddString( "itms-beta" );  // test flight

        // localizations
        PlistElementArray CFBundleLocalizations = rootDict.CreateArray( "CFBundleLocalizations" );
        CFBundleLocalizations.AddString( "en" );    // english
        CFBundleLocalizations.AddString( "de" );    // german
        CFBundleLocalizations.AddString( "fr" );    // french
        CFBundleLocalizations.AddString( "es" );    // spanish

        // for OneSigna remote notifications
        PlistElementArray UIBackgroundModes = rootDict.CreateArray( "UIBackgroundModes" );
        UIBackgroundModes.AddString( "remote-notification" );

        //WriteFile
        File.WriteAllText (plistPath, plist.WriteToString ());

    }

}
colinday
  • 71
  • 1
  • 2