Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on calling configureTheme #59

Closed
arorajatin opened this issue Jan 19, 2017 · 3 comments
Closed

Crash on calling configureTheme #59

arorajatin opened this issue Jan 19, 2017 · 3 comments

Comments

@arorajatin
Copy link

arorajatin commented Jan 19, 2017

Hey,

I recently saw a crash on Crashlytics, which happens when we call configureTheme method. The logs are pasted below.

The OS is 9.3.3 and the device is iPhone6

`Crashed: com.apple.main-thread
0 SwiftMessages 0x100f08ff4 _TFO13SwiftMessages9IconStyle5imagefT5themeOS_5Theme_CSo7UIImage + 1864

1 SwiftMessages 0x100ef24c4 TFC13SwiftMessages11MessageView14configureThemefTOS_5Theme9iconStyleOS_9IconStyle_T + 28

2 0x1004815a4 specialized static PPNotificationsController.showInAppCustomNotificationWith(title : String, body : String, userInfo : [AnyHashable : Any]?, onTapCompletion : ([AnyHashable : Any]) -> ()?) -> () (PPNotificationsController.swift:223)

3 0x100481fcc specialized static PPNotificationsController.showLocalNotificationWith(title : String, body : String, badge : Int?, userInfo : [AnyHashable : Any], identifier : String?, application : UIApplication, onTapCompletion : ([AnyHashable : Any]) -> ()?) -> () (PPNotificationsController.swift)

4 0x100482b30 specialized PPNotificationsController.didReceiveRemoteNotification(with : [AnyHashable : Any], principalController : PPPrincipalController, application : UIApplication, onTapCompletion : ([AnyHashable : Any]) -> ()?) -> () (PPNotificationsController.swift)

5 0x100455d5c specialized AppDelegate.application(UIApplication, didReceiveRemoteNotification : [AnyHashable : Any], fetchCompletionHandler : (UIBackgroundFetchResult) -> ()) -> () (AppDelegate.swift)

6 0x1004504a4 @objc AppDelegate.application(UIApplication, didReceiveRemoteNotification : [AnyHashable : Any], fetchCompletionHandler : (UIBackgroundFetchResult) -> ()) -> () (AppDelegate.swift)

7 UIKit 0x1893ee1a8 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 2676

8 UIKit 0x1893dbf84 -[UIApplication workspace:didReceiveActions:] + 136

9 FrontBoardServices 0x1859777ac FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 36

10 FrontBoardServices 0x185977618 -[FBSSerialQueue _performNext] + 168

11 FrontBoardServices 0x1859779c8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56

12 CoreFoundation 0x183f8d09c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24

13 CoreFoundation 0x183f8cb30 __CFRunLoopDoSources0 + 540

14 CoreFoundation 0x183f8a830 __CFRunLoopRun + 724

15 CoreFoundation 0x183eb4c50 CFRunLoopRunSpecific + 384

16 GraphicsServices 0x18579c088 GSEventRunModal + 180

17 UIKit 0x18919e088 UIApplicationMain + 204

18 App 0x1000beff0 main (AppDelegate.swift:15)

19 libdyld.dylib 0x183a528b8 start + 4`

This is how i'm using SwiftMessages

static func showInAppCustomNotificationWith(title: String, body: String, userInfo: [AnyHashable: Any]?, onTapCompletion: (([AnyHashable: Any]) -> Void)? = nil) {

    `//Show SwiftMessages view here
    
    let view: MessageView
    
    if #available(iOS 9.0, *) {
        view = MessageView.viewFromNib(layout: .CardView)
    } else {
        view = MessageView.viewFromNib(layout: .MessageViewIOS8)
    }        
    
    view.button?.isHidden = true
    view.configureTheme(.info)
    view.iconImageView?.image = UIImage(named: "ic_stat_notify_large")
    view.configureDropShadow()
    view.bodyLabel?.numberOfLines = 2
    view.configureContent(title: title, body: body)
    
    var config = SwiftMessages.Config()
    
    config.presentationContext = .window(windowLevel: UIWindowLevelStatusBar)
    config.presentationStyle = .top
    config.duration = .seconds(seconds: 4)
    
    view.tapHandler = { _ in
        
        if let userInfo = userInfo {
            onTapCompletion?(userInfo)
        }
        
    }
    
    SwiftMessages.show(config: config, view: view)
    
}`

Any ideas as to why this might be happening?
Any help is greatly appreciated.

@wtmoose
Copy link
Member

wtmoose commented Jan 19, 2017

Your crash log is really hard to read, but this sounds like a duplicate of #9. SwiftMessages is known to crash on jailbroken devices and given that I don't have a jailbroken device to test and nobody has attempted to solve this on their own, I don't have a fix. There is a workaround discussed in #9.

@arorajatin
Copy link
Author

Hey @wtmoose, thanks for replying. These are indeed jailbroken devices. I will look on how to workaround this issue. Closing this issue.

@ghost
Copy link

ghost commented Jan 20, 2017

@arorajatin Can you post back here if you find out how to work around this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants