安装字段parse.com obj-c中未显示任何内容 [英] Nothing showing in the installation field parse.com obj-c

查看:83
本文介绍了安装字段parse.com obj-c中未显示任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在手机上运行该应用程序时,似乎什么也没显示.即使我删除缓存.我的代码似乎很好.我不知道该怎么解决.我尝试添加频道,重置模拟器,甚至从手机中删除该应用程序.我该怎么做才能使这项工作成功?

Nothing seems to be showing when I run the app on my phone. Even when I delete the cache. My code seems fine. I don't know how to solve this. I've tried adding channels, reseting the simulator, and even deleteing the app from the phone. What can I do to make this work?

这是我的AppDelegate.m文件的代码:

Here's my code for the AppDelegate.m file:

#import "ParseExampleAppDelegate.h"

@implementation ParseExampleAppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    [[UITabBar appearance] setSelectedImageTintColor:[UIColor orangeColor]];


    [Parse setApplicationId:@"deletedforsecurity"
                  clientKey:@"deletedforsecurity"];


    // Register for Push Notitications, if running iOS 8
    if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
        UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
                                                        UIUserNotificationTypeBadge |
                                                        UIUserNotificationTypeSound);
        UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
                                                                                 categories:nil];
        [application registerUserNotificationSettings:settings];
        [application registerForRemoteNotifications];
    } else {
        // Register for Push Notifications before iOS 8
        [application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
                                                         UIRemoteNotificationTypeAlert |
                                                         UIRemoteNotificationTypeSound)];
    }


    return YES;


}


- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    // Store the deviceToken in the current installation and save it to Parse.
    PFInstallation *currentInstallation = [PFInstallation currentInstallation];
    [currentInstallation setDeviceTokenFromData:deviceToken];
    currentInstallation.channels = @[ @"global" ];
    [currentInstallation saveInBackground];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
    [PFPush handlePush:userInfo];
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end

感谢您的帮助,谢谢.

推荐答案

基于我们在评论中的对话;

Based on our conversation in the comments;

使用Parse后端,很可能您已在某个时间点从Installation类中删除了一个安装行.使用Parse,如果您删除了安装ID,它将保持该状态,直到您创建新的应用程序版本或更改安装类中的字段为止,因此,下一次用户打开应用程序时,将填充一个新的安装ID.

With Parse backend, it's highly likely that you have deleted an installation row from the Installation class at one point in time. Using Parse, if you have deleted a installation id it will retain that state until you create a new app version, or alter a field in the installation class, so the next time the user opens the app a new installation id will populate.

您所要做的就是更改Installation类中某些内容的版本,然后将填充新字段:

All you have to do is change a version of something in the Installation class and the new field will populate:

我建议将内部版本号增加1.您可以通过以下步骤进行操作:

I recommended incrementing the build number by 1. You can do this by the following :

我建议您不要删除安装行,除非您 1000%确定不需要安装行

I would recommend you not delete installation rows unless you are 1000% sure you don't need it

这篇关于安装字段parse.com obj-c中未显示任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆