سؤال

I want to integrate posting to Sina Weibo in my app for Chinese users, but I don't want the option to appear for the majority of my users who won't even know what Sina Weibo is. Is there a way that I can find out whether the user is chinese or not?

هل كانت مفيدة؟

المحلول

There is no way to figure out if a user is chinese. So you should use isAvailableForServiceType:.

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeSinaWeibo]) {
    // sina weibo is available, and at least one account is set up
}
else {
    // sina weibo is not available, or no accounts are set up
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top