简体   繁体   English

安装字段parse.com obj-c中未显示任何内容

[英]Nothing showing in the installation field 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? 我该怎么做才能使这项工作?

Here's my code for the AppDelegate.m file: 这是我的AppDelegate.m文件的代码:

#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

I appreciate any help, and thank you. 感谢您的帮助,谢谢。

Based on our conversation in the comments; 根据我们在评论中的对话;

With Parse backend, it's highly likely that you have deleted an installation row from the Installation class at one point in time. 使用Parse后端,很可能您已在某个时间点从Installation类中删除了一个安装行。 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. 使用Parse,如果您删除了安装ID,它将保留该状态,直到您创建新的应用程序版本或更改安装类中的字段为止,因此下次用户打开应用程序时,将填充一个新的安装ID。

All you have to do is change a version of something in the Installation class and the new field will populate: 您所要做的就是在Installation类中更改某些内容的版本,新字段将填充:

I recommended incrementing the build number by 1. You can do this by the following : 我建议将内部版本号增加1。您可以通过以下步骤进行操作:

PIC1

I would recommend you not delete installation rows unless you are 1000% sure you don't need it 我建议您不要删除安装行,除非您确信1000%不需要安装行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM