Last.FM for
iPhoneのビルド方法
 ∼とりあえず動かしたい人だけ∼




          written by Seasons
Open Sourceなので....


• Last.FMのiPhone版がでてるらしい
• 日本では買えない。海外だけ。
• でもソースは公開されてる
ならば、、、
 ビルドすればいいじゃないか!!


     と思ったら、、、



  挫折人多し。。。
つまりちゃんとした解説がない。
まずソースの場所


http://github.com/c99koder/lastfm-iphone/commit/
  0f442369c9b568852e6f82f2649c1f844e2cf75e




                  とりあえずzipで落とす
展開する




       apikey.h.in→apikey.h
         にリネーム(大事)
apikey.hを開く

//
// API Key Configuration
// Enter your API key and secret below
//

#define   API_URL "http://ws.audioscrobbler.com/2.0/"
#define   API_KEY ""
#define   API_SECRET ""
#define   PINCHMEDIA_ID @""




なんか、キーが必要なようだ・・・
    上2つは、どうやら、
 Last.FMのAPIのキーっぽい。
Last.FMのAPIサイトにいく


  http://www.lastfm.jp/api/
        ログインする




     apikey.hに書き込む
PINCHMEDIA_IDってなんだ?

  情報解析する為のライブラリSDKを
      動かす為のIDらしい




   そうですか、できないですか。
でもこれって動作させるだけには
   いらないでしょ?

ObjCには、カテゴリがある!!
  ということはインスタンスをnilにして
   動かしているフリをすればいい。

MobileLastFMApplicationDelegate.m
MobileLastFMApplicationDelegate.h


      これを改造することにした。
改造後
MobileLastFMApplicationDelegate.h
#import "Beacon.h"

@interface Beacon( Dummy )

+ (id)initAndStartBeaconWithApplicationCode:(NSString *)theApplicationCode useCoreLocation:(BOOL)coreLocation useOnlyWiFi:(BOOL)wifiState;
+ (void)endBeacon;
+ (id)shared;

@end


@interface MobileLastFMApplicationDelegate : NSObject<UIApplicationDelegate,UIActionSheetDelegate> {




MobileLastFMApplicationDelegate.m
NSString *kUserAgent;

@implementation Beacon( Dummy )

+ (id)initAndStartBeaconWithApplicationCode:(NSString *)theApplicationCode useCoreLocation:(BOOL)coreLocation useOnlyWiFi:(BOOL)wifiState {

    return nil;
}
+ (void)endBeacon {

    return;
}
+ (id)shared {

}
     return nil;
                                          nil最高!!
@end


@implementation MobileLastFMApplicationDelegate
ビルドする、転送する




     動いた!!
      enjoy!!
     Last.FM

How To Build Last Fm For I Phone

Editor's Notes