This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function base64url_encode($binary_data) { return strtr(rtrim(base64_encode($binary_data), '='), '+/', '-_'); } | |
| function apns_jwt_token($team_id, $key_id, $private_key_pem_str) | |
| { | |
| if (! function_exists('openssl_get_md_methods') || ! in_array('sha256', openssl_get_md_methods())) throw new Exception('Requires openssl with sha256 support'); | |
| $private_key = openssl_pkey_get_private($private_key_pem_str); | |
| if (! $private_key) throw new Exception('Cannot decode private key'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://statici.icloud.com/fmipmobile/deviceImages-9.0/iPhone/iPhone9,4-2-3-0/online-infobox__3x.png | |
| A B C D E F G | |
| A: deviceImages version seems to determine the format of the image specifier (C, D, E, F) | |
| B: device marketing name | |
| C: device model identifier | |
| D: color cover glass (front color) | |
| 1 - Black | |
| 2 - White | |
| E: device enclosure color (back color) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| extension UIViewController { | |
| func setTabBarVisible(visible:Bool, animated:Bool) { | |
| //* This cannot be called before viewDidLayoutSubviews(), because the frame is not set before this time | |
| // bail if the current state matches the desired state | |
| if (tabBarIsVisible() == visible) { return } |