Search code examples
iphoneiosobjective-cios6in-app-purchase

prevent fake in app purchase on jailbroken device


I am working on a project, in which I have included consumable In-App purchase. Now on jailbroken device, user can make fake in-app purchase. I have already included Receipt Verification code

How to prevent it ? Is there anything I am missing here ? Is it possible to check a device is jailbroken or not ?


Solution

  • is possible know if your app are running in a jailbroken device, most of all jailbroken devices have an app called Cydia, you can check if this app exist:

    +(BOOL)isJailbroken {
    NSURL* url = [NSURL URLWithString:@"cydia://package/com.example.package"];
    return [[UIApplication sharedApplication] canOpenURL:url];
    }
    

    Cydia has a URL scheme cydia:// which can be legally checked with UIApplication canOpenURL: