Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Fix App crashing on iOS 13 - Must return MPRemoteCommandHandlerStatus…
Browse files Browse the repository at this point in the history
… , Nav Bar color (#384)
  • Loading branch information
illwss authored and hebertialmeida committed Aug 29, 2019
1 parent 3139fdf commit e67424b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Source/FolioReaderAddHighlightNote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class FolioReaderAddHighlightNote: UIViewController {
textView.delegate = self
textView.translatesAutoresizingMaskIntoConstraints = false
textView.textColor = .black
textView.backgroundColor = .clear
textView.font = UIFont.boldSystemFont(ofSize: 15)
containerView.addSubview(textView)

Expand All @@ -108,7 +109,6 @@ class FolioReaderAddHighlightNote: UIViewController {
let rightConstraint = NSLayoutConstraint(item: textView!, attribute: .right, relatedBy: .equal, toItem: containerView, attribute: .right, multiplier: 1.0, constant: -20)
let topConstraint = NSLayoutConstraint(item: textView, attribute: .top, relatedBy: .equal, toItem: containerView, attribute: .top, multiplier: 1, constant: 100)
let heiConstraint = NSLayoutConstraint(item: textView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .height, multiplier: 1, constant: view.frame.height - 100)

containerView.addConstraints([leftConstraint, rightConstraint, topConstraint, heiConstraint])
}

Expand All @@ -130,7 +130,7 @@ class FolioReaderAddHighlightNote: UIViewController {
}

private func configureNavBar() {
let navBackground = folioReader.isNight(readerConfig.nightModeMenuBackground, UIColor.white)
let navBackground = folioReader.isNight(self.readerConfig.nightModeNavBackground, self.readerConfig.daysModeNavBackground)
let tintColor = readerConfig.tintColor
let navText = folioReader.isNight(UIColor.white, UIColor.black)
let font = UIFont(name: "Avenir-Light", size: 17)!
Expand Down
29 changes: 23 additions & 6 deletions Source/FolioReaderAudioPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,33 @@ open class FolioReaderAudioPlayer: NSObject {

let command = MPRemoteCommandCenter.shared()
command.previousTrackCommand.isEnabled = true
command.previousTrackCommand.addTarget(self, action: #selector(playPrevChapter))
command.previousTrackCommand.addTarget(handler: { (event) in
self.playPrevChapter()
return MPRemoteCommandHandlerStatus.success}
)

command.nextTrackCommand.isEnabled = true
command.nextTrackCommand.addTarget(self, action: #selector(playNextChapter))
command.nextTrackCommand.addTarget(handler: { (event) in
self.playNextChapter()
return MPRemoteCommandHandlerStatus.success}
)

command.pauseCommand.isEnabled = true
command.pauseCommand.addTarget(self, action: #selector(pause))
command.pauseCommand.addTarget(handler: { (event) in
self.pause()
return MPRemoteCommandHandlerStatus.success}
)

command.playCommand.isEnabled = true
command.playCommand.addTarget(self, action: #selector(play))
command.playCommand.addTarget(handler: { (event) in
self.play()
return MPRemoteCommandHandlerStatus.success}
)
command.togglePlayPauseCommand.isEnabled = true
command.togglePlayPauseCommand.addTarget(self, action: #selector(togglePlay))

command.togglePlayPauseCommand.addTarget(handler: { (event) in
self.togglePlay()
return MPRemoteCommandHandlerStatus.success}
)
registeredCommands = true
}
}
Expand Down

14 comments on commit e67424b

@HariMohan-eng
Copy link

@HariMohan-eng HariMohan-eng commented on e67424b Oct 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unsupported action method signature. Must return MPRemoteCommandHandlerStatus or take a completion handler as the second argument.' in xcode 11.

@HariMohan-eng
Copy link

@HariMohan-eng HariMohan-eng commented on e67424b Oct 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have manually set up your last committed code, but after that i can also get realm primary key error. please fix it ASAP. I have also try reinstall or update your cocoapods in xcode 11.

if i install realm first, after that your library then i will get 680 errors with xcode 11, ios 13.

@vivekalagark
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I'm also facing the same error as @HariMohan-eng said. Pls fix it ASAP.

@bhparkdev
Copy link

@bhparkdev bhparkdev commented on e67424b Oct 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Thank you for maintaining the Folioreader Kit.
But, because I'm facing the same problem,
We are waiting to be corrected and distributed to Cocoapod as soon as possible.

If it is difficult to deploy quickly, please provide a manual way to install the framework into the project.
I tried everything I knew, but they all failed.
I'm very nervous. I don't think I can get paid.

@vivekalagark
Copy link

@vivekalagark vivekalagark commented on e67424b Oct 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @HariMohan-eng @bhparkdev,
Error got fixed.
i gave pod 'FolioReaderKit' and that's the problem it updates the old build.
I changed it to like below mentioned,
pod 'FolioReaderKit', git: 'https://github.com/FolioReader/FolioReaderKit.git'

and it worked..

@HariMohan-eng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
I have removed folio reader from pod, and reinstall it, but facing same issue.
its working below xcode 11 but not working in xcode11.

@vivekalagark
Copy link

@vivekalagark vivekalagark commented on e67424b Oct 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
I'm using xcode 11 and it's woking fine for me now.
When i give the pod 'FolioReaderKit', git: 'https://github.com/FolioReader/FolioReaderKit.git' in my podfile ,
it installs realm 3.17 version and the crash issue is resolved.
P.S. You have to try it with the path
pod 'FolioReaderKit', git: 'https://github.com/FolioReader/FolioReaderKit.git'

@HariMohan-eng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay,
sorry actually i have added only pod 'FolioReaderKit'.

now i have added pod 'FolioReaderKit', git: 'https://github.com/FolioReader/FolioReaderKit.git'. and its working for me.

Thanks for your response.

@vivekalagark
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool no problem.Glad, it helps.. :)

@HariMohan-eng
Copy link

@HariMohan-eng HariMohan-eng commented on e67424b Oct 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
i want to minor changes in your library. When the ePub book size is more like 200 pages, then activity indicator is stop and "didFinishedLoading" method is called. but book takes time like 20 more seconds to load.

So i need :- activity indicator will stop when book loaded successfully. (when successfully display on iPhone)

@objc func folioReader(_ folioReader: FolioReader, didFinishedLoading book: FRBook) {
print("loaded")
}

@HariMohan-eng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Have you fixed late loading issue?

@HariMohan-eng
Copy link

@HariMohan-eng HariMohan-eng commented on e67424b Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI hebertialmeida,
We have tried multiple time to fix the UIWebview to WKWebview, but facing more issue.
can you fix on your end, so we can try to update your library in our project.

Your library is great for iOS 13 and below. But when we run in iOS 13.1, 13.2, 13.3 many issues occurs like, highlight is not working, chapter link not working, got error of UIWebview deprecated so in future apple will not accept and so on. Please resolve all issues.

Thanks!!!

@ChetanKailodiaIOS
Copy link

@ChetanKailodiaIOS ChetanKailodiaIOS commented on e67424b Feb 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi FolioReader Team
i have problem on ios 13.1 the error is "Primary key property 'name' does not exist on object 'RealmSwiftClassPermission" and that problem on class "RLMObjectSchema.mm" Line number - 164 . please give me solution ASAP.

Thanks

@HariMohan-eng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Team,
There are many problems occurs for iOS 13.1,13.2,13.3. Please replace UIWebview to WKWebView.

Thanks!!!

Please sign in to comment.