My App is display the image on the HDMI TV.I have created i custom receiver http://photo-genie.com/photogenie1.html (my receiver.html). when i send a message from my code this method is not getting called.Something i missing please someone give the solution.i have searched but didn't get any solution.some help me thanks in advance.
here is my code send and receive the image message...
This method is not getting called when i send the image message to the receiver...
- (void)didReceiveTextMessage:(NSString*)message {
NSLog(@"received message: %@", message);
}
I am sending a image to the receiver that is display on the TV. here is the sending code..
- (IBAction)castImage:(id)sender {
NSLog(@"sending text %@", _image1.image);
if (!_deviceManager || !(_deviceManager.connectionState == GCKConnectionStateConnected)) {
UIAlertController *alert =
[UIAlertController alertControllerWithTitle:@"Not Connected"
message:@"Please connect to Cast device"
preferredStyle:UIAlertControllerStyleAlert];
[self presentViewController:alert animated:YES completion:nil];
return;
}
CastChannelData *textChannel =_imageChannel;
NSString *messageString = [NSString stringWithFormat:@"%@",_image1.image];
[textChannel sendTextMessage:messageString];
}
here is the application metadata channel code..
- (void)deviceManager:(GCKDeviceManager *)deviceManager didConnectToCastApplication:(GCKApplicationMetadata *)applicationMetadata sessionID:(NSString *)sessionID launchedApplication:(BOOL)launchedApplication {
if (launchedApplication) {
NSLog(@"application has launched");
self.imageChannel =
[[CastChannelData alloc] initWithNamespace:@"urn:x-cast:com.google.cast.photogenie.custom"];
[_deviceManager addChannel:_imageChannel];
}else {
NSLog(@"application has Not launched");
}
}
someone please help me.Thanks in advance