zoukankan      html  css  js  c++  java
  • IOS添加openfeint的图文步骤<原创>

    刚好帮同事做Openfeit平台,顺便给写个添加openfeint的图文步骤
    1.打开http://www.openfeint.com/,点击左上角的Developers

    2.注册openfeint,登录,找到downloads界面,下载最新的openfeint

    3.打开SDK,把openfeint文件夹拷到你的工程目录,还要一个Delegates文件,这个我有修改它SampleDelegates弄了一个,由于不能上传附件,下次有空时传到网盘在共享下,不然你也可以自己修改下MyOpenFeintSample下的SampleDelegates.

    4打开你的工程,导入openfeint和Delegates文件,在other sources里的.pch文件中加入 #import "OpenFeintPrefix.pch"
    5.右击工程名,选择get info.在build选项卡中,选择All Configurations和All Settings.找到Linking->Other Linker Flags,加入"-ObjC" 


    6.双击targets目录下的工程的target,在General选项卡中添加

    • Foundation
    • UIKit
    • CoreGraphics
    • QuartzCore
    • Security
    • SystemConfiguration
    • libsqlite3.0.dylib
    • MobileCoreServices
    • CFNetwork
    • AddressBook
    • AddressBookUI
    • GameKit
    • CoreLocation
    • MapKit
    • libz.1.2.3.dylib                  


    7.很关键的一步要把所有关联到openfeint的源文件都改成.mm的7.进行openfeint的初始化,在你的工程(工程名)Delegate头文件中,加入
    @class MyOFDelegate; // Add for OpenFeint

    #import "OpenFeint.h"

    #import "MyOFDelegate.h"

            MyOFDelegate *ofDelegate; // Add for OpenFeint

    在你的源文件applicationDidFinishLaunching中加入

     NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight], 
                                                              OpenFeintSettingDashboardOrientation, [NSNumber numberWithBool:YES],
                                                              OpenFeintSettingDisableUserGeneratedContent, nil];
            ofDelegate = [MyOFDelegate new];
            OFDelegatesContainer* delegates = [OFDelegatesContainer containerWithOpenFeintDelegate:ofDelegate];
            [OpenFeint initializeWithProductKey:@"qAgeIQ4ozRVT5r04OsTEg"
                                                              andSecret:@"DFPK6OmLIYbhMkoPzBaHpRpaOotPmoB37FzMua0yvE"
                                                     andDisplayName:@"Snial"
                                                            andSettings:settings    // see OpenFeintSettings.h
                                                       andDelegates:delegates]; // see OFDelegatesContainer.h
    

      

    8.在Openfeit官网中注册一个项目,会得到相应的ProductKey和Secret

    9.启动排行榜[OpenFeint launchDashboardWithHighscorePage:(NSString*)@"排行榜id";上传最高分 [OFHighScoreService setHighScore:allscore forLeaderboard:@"排行榜id" onSuccess:OFDelegate() onFailure:OFDelegate;

      好久没发这么长的帖子了,由于时间仓促,难免有些遗漏,大家可以查阅官方的相关文档,欢迎大家指正交流

      注:这篇有先发于泰然论坛,From mobileworm,欢迎转载

  • 相关阅读:
    反射技术的入口 获取类的Class信息
    Dom4j(Dom for Java) Day24
    通过反射 修改访问和修改属性的值 Day25
    通过反射 往泛型Integer的集合里添加String 类型的数据 Day25
    计算机网络(七),TCP与UDP的区别
    计算机网络(六),UDP报文段详解
    计算机网络(五),TCP四次挥手
    计算机网络(四),TCP三次握手
    计算机网络(三),TCP报文段详解
    计算机网络(二),TCP/IP四层模型常见协议
  • 原文地址:https://www.cnblogs.com/mobileworld/p/2223748.html
Copyright © 2011-2022 走看看