小编Gho*_*use的帖子

使用新的sdk在我的Facebook墙上发布

我正在使用新的Facebook SDK按照他们的指示在我的墙上发布

我从应用程序获得授权,但当我尝试发布时,我收到错误 Error: HTTP status code: 400,我发布了我的代码

 - (void)viewDidLoad
{
self.postParams =
 [[NSMutableDictionary alloc] initWithObjectsAndKeys:
 @"https://developers.facebook.com/ios", @"link",
 @"https://developers.facebook.com/attachment/iossdk_logo.png", @"picture",
 @"Facebook SDK for iOS", @"name",
 @"build apps.", @"caption",
 @"testing for my app.", @"description",
 nil]; 

[self.postParams setObject:@"hgshsghhgsls" forKey:@"message"];

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

-(IBAction)Post{
AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
[appDelegate openSessionWithAllowLoginUI:YES];


[FBRequestConnection   startWithGraphPath:@"me/Mac" parameters:self.postParams HTTPMethod:@"POST"
                        completionHandler:^(FBRequestConnection *connection,id result,NSError *error) {
                            NSString *alertText;
                             if (error) {
                             alertText = …
Run Code Online (Sandbox Code Playgroud)

iphone facebook ios

11
推荐指数
2
解决办法
1万
查看次数

发送短信,等待额外的意图覆盖

嗨,我正在通过我的服务中的SmsManager从我的应用程序发送消息,并为要发送和传递的短信注册广播接收器,我希望在消息到达或不到达时更新消息状态。按照现在,我可以通过将带有行ID的Extras放在带有flag的Pending Intent中来发送消息PendingIntent.FLAG_UPDATE_CURRENT。但是,一旦发送了消息,我将只接收广播事件以及最后一行的额外内容,而我无法检索其他行的额外内容。我正在使用PendingIntent.FLAG_UPDATE_CURRENT,这就是为什么其他函数被覆盖的原因,我也检查了其他标志,但没有用。如何在不被覆盖的情况下获得其他行的额外内容?我在服务中发送短信的另一件事是这种方法正确吗?任何建议都会有
很大帮助。

  String mSelectionClause = MyContentprovider.STATUS+ " = ?";
                 String[] mSelectionArgs = {"fail"};


                    Uri students = MyContentprovider.CONTENT_URI_SENDMSG;
                    Cursor c = getContentResolver().query(students, null, mSelectionClause, mSelectionArgs, "userphno");
                    if (c.moveToFirst()) {
                       do{



                               String SENT = "SMS_SENT";
                                String DELIVERED = "SMS_DELIVERED";

                                Intent SENTINTENT=new Intent(SENT);
                                SENTINTENT.putExtra("id",c.getString(c.getColumnIndex( MyContentprovider._ID)));
                                SENTINTENT.putExtra("userno", c.getString(c.getColumnIndex( MyContentprovider.USER_PHNO)));
                            if(c.isLast()){

                                SENTINTENT.putExtra("lastrow", "true");

                            }


                                Intent DELIVEREDINTENT=new Intent(DELIVERED);
                                DELIVEREDINTENT.putExtra("id",c.getString(c.getColumnIndex( MyContentprovider._ID)));
                                DELIVEREDINTENT.putExtra("userno", c.getString(c.getColumnIndex( MyContentprovider.USER_PHNO)));

                                  PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,
                                          SENTINTENT, PendingIntent.FLAG_UPDATE_CURRENT);


                                  PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,
                                          DELIVEREDINTENT, PendingIntent.FLAG_UPDATE_CURRENT);

                                  String msg= c.getString(c.getColumnIndex( MyContentprovider.MESSAGE));

                       SmsManager sms …
Run Code Online (Sandbox Code Playgroud)

android android-service android-broadcast

1
推荐指数
1
解决办法
660
查看次数