tvos

tvos Location Services prompt never prompted

假如想象 提交于 2019-12-13 07:24:34
问题 Have anyone gotten CLLocationManager to prompt for permission on tvos? I'm using the following code (that works on other platforms) to get a user's location and prompt for permissions. self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers; self.locationManager.delegate = self; [self.locationManager requestWhenInUseAuthorization]; [self.locationManager requestLocation]; However, the authorization delegate is called

Call Swift code from an Apple TV TVML TVJS JavaScript App

不打扰是莪最后的温柔 提交于 2019-12-13 06:12:36
问题 I have a basic TVML application set up. Currently simple events (such as a button press) are handled via JavaScript (TVJS). When the user presses a button (provided via TVML template) I'd like some code to run in Swift instead, that manipulates UI elements. What's the best way to do this? 回答1: You can use evaluateAppJavaScriptIn method in TVApplicationControllerDelegate as below and write corresponding swift method in it; (swift side) // MARK: TVApplicationControllerDelegate func

AVPlayer/AVPlayerViewController giving warnings when I am trying to play/stop

帅比萌擦擦* 提交于 2019-12-13 04:27:41
问题 When I am playing video form this URL. http://www.html5videoplayer.net/videos/toystory.mp4 I am getting below warnings. let videoURL = URL(string: "http://www.html5videoplayer.net/videos/toystory.mp4") player = AVPlayer(url: videoURL!) iOS:- Here I am using AVPlayer to load URL and play video when I click on play button <2DAD5582-1C08-4D06-8FAF-DDDDE0681EC0>.<9> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey= http://www

Line Wrap description text in a compilationTemplate's relatedContent area in TVML

流过昼夜 提交于 2019-12-13 01:13:58
问题 How can I wrap the description text in the relatedContent area of a compilationTemplate ? My description tag: <description style="tv-text-style: none; font-size:36; font-weight:regular; word-wrap:break-word;">lorem ipsum dolor sit amet consectetur adipiscing elit</description> Full template: var Template = function() { return `<?xml version="1.0" encoding="UTF-8" ?> <document> <compilationTemplate theme="light"> <list> <relatedContent> <itemBanner> <heroImg src="${this.BASEURL}images/shows

My react native encountered a problem while building tvOS but iOS succeeded

放肆的年华 提交于 2019-12-12 16:46:32
问题 I followed the link below to install new reactNative App .. https://facebook.github.io/react-native/docs/getting-started After Successfully Installed I am able to run the iOS target but not tvOS while running tvOS I am getting below error .. Library not found for -lPods-AwesomeProject-tvOS It seems in podfile cocoapods not included for tvos target .. So I added cocoaPods for tvos target and then build again but getting below warning and errors.. I am also adding my Podfile here please suggest

Add my app to tvOS app settings screen

喜夏-厌秋 提交于 2019-12-12 10:55:23
问题 How do you add app settings to tvOS like you do in iOS. I assume that just like iOS the screen below, you can add the settings for your own application 回答1: There isn't a Settings Bundle in tvOS section in Xcode, but you can select the Settings Bundle from iOS section, it's a bit tricky but it definitely works. 1. File -> New -> File 2. iOS -> Resource -> Settings Bundle 3. Edit your Bundle Settings plist 4. Build and Run N.B. tvOS and Xcode 7.1 now is in beta, maybe Apple will add "Settings

TVOS: UIButton action not working in subview

六月ゝ 毕业季﹏ 提交于 2019-12-12 04:16:39
问题 in the TVOS Application storyboard mainview I added a subview. Within the subview there are 3 button created in the very same way (the code here belongs to the subview) UIButton *b = [UIButton buttonWithType:UIButtonTypeSystem]; b.frame = CGRectMake(left, top, 400, size); [b setTitle:@"Click Me" forState:UIControlStateNormal]; [b addTarget:self action:@selector(Action_Up) forControlEvents:UIControlEventPrimaryActionTriggered]; [self.view addSubview:b]; ... -(void)Action_Up { [self ShowData];

Add Action To Apple TV Remote Play/Pause Button

我只是一个虾纸丫 提交于 2019-12-12 03:36:13
问题 I have an AVAudioPlayer in my app and I am adding a function where the user can press the Play/Pause button on the remote to Play/Pause the AVAudioPlayer. I have this code in my App Delegate: func initializePlayButtonRecognition() { addPlayButtonRecognizer(#selector(AppDelegate.handlePlayButton(_:))) } func addPlayButtonRecognizer(_ selector: Selector) { let playButtonRecognizer = UITapGestureRecognizer(target: self, action:selector) playButtonRecognizer.allowedPressTypes = [NSNumber(value:

Invert Scrolling in UICollectionView of tvOS

安稳与你 提交于 2019-12-12 02:38:09
问题 In my tvOS app, I have a UICollectionView. When I scroll from top to bottom on the Siri Remote, it it moves the view down. This is the opposite of how most Collection Views would work. I want it to behave like a trackpad, when you scroll from bottom to top, have it move the collection view down. How can I invert this scrolling behavior? 回答1: You don't want to move away from Apple TV standards. Your goal in making a tvOS application is not to create an entirely different piece of software, but

Is it possible to use PanGestureRecognizer for tvOS?

旧巷老猫 提交于 2019-12-12 02:37:07
问题 I just started building first apps for tvOS and I'm curious about its gesture recognition abilities. My goal is to know the direction and displacement of a finger swipe on the apple tv remote. I know how I can detect tap or swipe, even the direction of the swipe, but not the displacement, in other words I don't know how many points I moved my finger up/down/left/right. If anyone knows how to do such thing, please share with me. Any kind of help is highly appreciated. 回答1: Yes it is! Check