-2

how to detect whether the user hear this audio in proximity or not?

S. Karthik
  • 618
  • 5
  • 16

2 Answers2

0

First detect state of Proximity Sensor using iPhone Proximity Sensor and then play audio using phone call speaker Play audio through upper (phone call) speaker

Community
  • 1
  • 1
Dhaval Patel
  • 95
  • 12
0
[[UIDevice currentDevice] setProximityMonitoringEnabled:YES]
[[NSNotificationCenter defaultCenter] addObserver:self
    selector:@selector(sensorStateChange:)
    name:@"UIDeviceProximityStateDidChangeNotification" object:nil];
Michaël Azevedo
  • 3,874
  • 7
  • 31
  • 45
Dan
  • 141
  • 3