2
0

BroadcastSetupViewController.m 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. //
  2. // BroadcastSetupViewController.m
  3. // BroadcastSetupUI
  4. //
  5. // Created by Rain on 2022/10/11.
  6. // Copyright © 2022 WildFireChat. All rights reserved.
  7. //
  8. #import "BroadcastSetupViewController.h"
  9. @implementation BroadcastSetupViewController
  10. // Call this method when the user has finished interacting with the view controller and a broadcast stream can start
  11. - (void)userDidFinishSetup {
  12. // URL of the resource where broadcast can be viewed that will be returned to the application
  13. NSURL *broadcastURL = [NSURL URLWithString:@"http://apple.com/broadcast/streamID"];
  14. // Dictionary with setup information that will be provided to broadcast extension when broadcast is started
  15. NSDictionary *setupInfo = @{ @"broadcastName" : @"example" };
  16. // Tell ReplayKit that the extension is finished setting up and can begin broadcasting
  17. [self.extensionContext completeRequestWithBroadcastURL:broadcastURL setupInfo:setupInfo];
  18. }
  19. - (void)userDidCancelSetup {
  20. // Tell ReplayKit that the extension was cancelled by the user
  21. [self.extensionContext cancelRequestWithError:[NSError errorWithDomain:@"YourAppDomain" code:-1 userInfo:nil]];
  22. }
  23. @end