最近ソーシャル系のSDKばかり試している気がしますが、今回は Lobi の チャットSDK を導入してみようと思います。
こちらのドキュメント を見ながらすすめました。
基本的に問題は無かったのですが、何点か修正した箇所があったのでメモを残しておきます。
Lobi SDKとは
どんなアプリにもコミュニケーションエンジンを導入できるグループチャットSDKです。
ユーザーは電話番号などの個人情報を登録せず、気軽にグループチャットを楽しめます!
※グループチャットの利用はFacebookかTwitterのアカウントを使用します。
初心者質問チャットや、スコア・アイテム自慢チャットなど、全ユーザーが楽しめるオープンチャットはあなたのアプリをきっと盛り上げてくれます。
http://developer.lobi.co/ja/about より引用
簡単な作業メモ その1
ビフォー
NKBadgeButton *button = [[[NKBadgeButton alloc] init] autorelease]; // autorelease unavailable in automatic reference counting mode button.frame = CGRectMake(self.view.frame.size.width - 71, 0, 66, 32); [button addTarget:self action:@selector(showNakamapView) forControlEvents:UIControlEventTouchUpInside];
autorelease unavailable in automatic reference counting mode という警告が出ていたため下記のように修正しました。
アフター
NKBadgeButton *button = [[NKBadgeButton alloc] init]; button.frame = CGRectMake(self.view.frame.size.width - 71, 0, 66, 32); [button addTarget:self action:@selector(showNakamapView) forControlEvents:UIControlEventTouchUpInside];
簡単な作業メモ その2
ビフォー
- (void)showNakamapView { NKNakamapViewController *viewController = [[[NKNakamapViewController alloc] init] autorelease]; // autorelease unavailable in automatic reference counting mode [self presentModalViewController:viewController animated:YES]; // presentModalViewController:Animated is deprecated in ios6 }
- autorelease unavailable in automatic reference counting mode
- presentModalViewController:Animated is deprecated in ios6
という警告が出たので、
それぞれ下記のように修正しました。
アフター
- (void)showNakamapView { NKNakamapViewController *viewController = [[NKNakamapViewController alloc] init]; [self presentViewController:viewController animated:YES completion:nil]; }
なんということでしょう。たったこれだけで簡単にチャット機能を組み込むことができました。
非常にお手軽ですね。