Buildfix for iOS SDK < 7

Buildfix for iOS SDK < 7. #5235

Also fixes controller reconnection after switching applications.