Snippets

King Liao Unity 5.5 Fixing FB SDK Bug - Override Default iOS UnityAppController

Created by King Liao
1
2
3
4
5
6
7
#import "UnityAppController.h"

@interface OverrideUnityAppController : UnityAppController

- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation;

@end
#import "OverrideUnityAppController.h"

#include "PluginBase/AppDelegateListener.h"


@implementation OverrideUnityAppController

- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
{
    NSMutableArray* keys	= [NSMutableArray arrayWithCapacity:3];
    NSMutableArray* values	= [NSMutableArray arrayWithCapacity:3];
    
    auto addItem = [&](NSString* key, id value)
    {
        [keys addObject:key];
        if (value == nil) {
            [values addObject:[NSNull null]];
        } else {
            [values addObject:value];
        }
    };
    
    addItem(@"url", url);
    addItem(@"sourceApplication", sourceApplication);
    addItem(@"annotation", annotation);
    
    NSDictionary* notifData = [NSDictionary dictionaryWithObjects:values forKeys:keys];
    AppController_SendNotificationWithArg(kUnityOnOpenURL, notifData);
    return YES;
}

@end

IMPL_APP_CONTROLLER_SUBCLASS(OverrideUnityAppController)

Comments (1)

  1. Zafer özkel

    https://hubpages.com/@agariounblocked
    https://www.discogs.com/user/12agariounblocked
    https://active.popsugar.com/@agarioplay/profile
    https://myanimelist.net/profile/agarioplay
    https://www.ranker.com/writer/efe-han-ozkel
    https://smkanderson.edu.my/adc/members/agario/
    https://osf.io/7tdgp/
    https://cyber.harvard.edu/cyberlaw_winter10/Agario
    https://moz.com/community/q/user/uflee37
    https://agariounblocked.medium.com/agario-ceec6c3cebb9
    http://t.me/iv?url=https://editsizserverler.org
    http://t.me/iv?url=https://agario.boston
    http://t.me/iv?url=https://agario.id
    https://ko-fi.com/agario535395282
    https://www.crunchyroll.com/user/Agario244
    https://disqus.com/by/disqus_XTOlCAa04j/
    https://www.minds.com/agario463/about
    https://onedio.com/profil/agario637/
    https://www.behance.net/agarioagario
    https://qiita.com/Agario433
    https://tr.gravatar.com/agario5534
    https://www.instructables.com/member/Agario5353/?publicPreview=true
    https://dribbble.com/Agario6457
    https://www.magcloud.com/user/agario543
    https://www.goodreads.com/user/show/149078206-agario
    https://agario4665.livejournal.com/profile
    https://www.dead.net/member/agario57546
    https://penzu.com/p/5baa67e3
    https://www.instapaper.com/read/1491741037
    https://qr.ae/pGLSjQ
    https://qr.ae/pGLSQN
    https://www.goodreads.com/user/show/149079025-agario-unblocked
    https://tr.gravatar.com/agariounblocked443
    https://www.google.com/url?sa=t&url=http%3A%2F%2Fagario.boston
    https://google.com/url?sa=t&url=http%3A%2F%2Fagario.boston
    https://www.google.com/url?sa=t&url=https%3A%2F%2Fagario.boston
    https://www.google.com/url?sa=t&url=http%3A%2F%2Fwww.agario.boston

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.