Legoless / Alpha

Next generation debugging framework for iOS
https://github.com/Legoless/Alpha
MIT License
731 stars 45 forks source link

Appdelegate support custom window #54

Closed OdNairy closed 8 years ago

OdNairy commented 8 years ago

Current implementation doesn't work for not-storyboard based rootViewControllers. We will use not storyboard-based rootVC in the case of custom controller stack initialisation (some state preservation e.g.).

Legoless commented 8 years ago

Sorry, but I cannot merge this. Can you provide a sample project, where Alpha would not work? What exactly does it happen, e.g. how it doesn't work?

With last commit you are breaking the correct Alpha integration (I've had this notification center hook in originally), by integrating Alpha with UIApplicationDidFinishLaunchingNotification notification. This notification is sent AFTER method is called (applicationDidFinishLaunching:launchOptions:). Because Alpha hooks into the entire app delegate, this would not get delegate callbacks if developer registers for push notifications in that method - which is what usually happens. That is why Alpha is hooked into the delegate sooner, so it catches registerForRemoteNotifications callbacks.

Please provide me an example project, so I can see what happens and I'll try to find another solution.

OdNairy commented 8 years ago

Check the example on Dropbox link: https://www.dropbox.com/s/5ftu4qhidh36idj/alphapr54example.zip?dl=0 In Podfile you can find two styles of pod 'Alpha' - the first one is the basic usage type and the second aims to my fixed branch. Run the app and try to proceed ALPHATapTrigger. On the basic setup the keyWindow for Trigger is nil (since delegate.window is not ready yet). To get more technical information set a breakpoint on ALPHATapTrigger.m line 37. If Alpha framework needs catch delegate callback before the real call we need to split triggers initialisation and registerForRemoteNotifications.

OdNairy commented 8 years ago

Branch was updated to avoid merge conflict.

Legoless commented 8 years ago

Closing this, fixed in 0.2.6.