문제

I'm trying to simulate the "home button pressed" on iOS 7 but the previous method used on iOS 6 doesn't work. I speak of course of a jailbroken device.

#include "GSEvent.h"

    - (void)simulateHomeButton
    {
       struct GSEventRecord record;
       memset(&record, 0, sizeof(record));
       record.type = kGSEventMenuButtonDown;
       record.timestamp = GSCurrentEventTimestamp();
       GSSendSystemEvent(&record);
       record.type = kGSEventMenuButtonUp;
       GSSendSystemEvent(&record);
    }

*UPDATE What I really need is a generic method like the old one that let me to simulate the pressure of all physical buttons

도움이 되었습니까?

해결책

Try this.

[[%c(SBUIController) sharedInstance]clickedMenuButton];

다른 팁

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top