iPhone应用程序中的应用内评论功能

时间:2010-06-02 13:03:53

标签: ios objective-c review

我最近在一些应用程序中看到,可以将评论和评级(有5颗星)集成到应用程序中。有谁知道这是怎么做到的?例如有http请求吗?

更具体:我可以使用UITextField和Button在我的应用程序中创建一个视图,这样当用户在文本字段中写下他的评论并单击发送时,评论应该发布到App中的“客户评论”商店?评级也应该在App内部进行。

3 个答案:

答案 0 :(得分:10)

是的,我用我自己的应用做到了这一点。我有一个评级按钮,点击以下方法:

- (IBAction) reviewPressed: (id) source { 
NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=341086403"; 
   [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}

您需要使用自己的应用ID替换URL中的ID。对于新的应用程序,这会给您带来鸡蛋和鸡蛋问题 - 在应用程序上线之前您没有ID。

答案 1 :(得分:6)

您可以在提交应用程序的过程中获取应用程序ID,但稍后选择上传应用程序二进制文件。然后,您将获得应用程序ID,从而将其添加到您的代码中。

答案 2 :(得分:2)

我认为它已经很晚了,但这是最好的解决方案。 您可以使用以下网址直接发送用户在App Store上撰写评论页面。只需要替换应用程序ID

  

ITMS的应用程式://itunes.apple.com/gb/app/id1136613532动作=写评论&安培; MT = 8

示例:

var arr1 = ...;
var arr2 = ...;

function diff(arr1, arr2) {
    var dupes = [],
        originalItems = [];

    arr2.forEach(function(o2) {               // for each object o2 in arr2
        var test = arr1.some(function(o1) {   // check if there is some object from arr1 that has the same name
            return o1.name === o2.name;
        });
        if(test)                              // if there is
            dupes.push(o2);                   // then push it into the dupes array
        else                                  // if not
            originalItems.push(o2);           // then it is an original
    });

    return {                                  // return like this is much organized
        dupes: dupes,
        originalItems: originalItems
    };
}   

var res = diff(arr1, arr2);                    // the result is an object containing two arrays: the dupes one and the originalItems one

console.log(res.dupes);
console.log(res.originalItems);

此处我的申请ID为 1136613532 。你可以用你的替换它。 在iOS 10.3中测试

相关问题