1

내 앱에서 Urban 비행선을 사용하여 푸시 알림을 받고 예상대로 작동합니다. 문제는 내 응용 프로그램이 포 그라운드에서 실행되고 푸시받은 때 나는 this-iOS 앱이 포 그라운드에서 실행 중일 때 푸시 알림 제목을 변경하는 방법은 무엇입니까?

을 시도 알림 대신 NOTIS로 제목을 표시 할 payload.But의 정보와 함께 제목으로 알림을 보여주고 있다는 것입니다
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { 

    if (application.applicationState == UIApplicationStateActive) 
    { 
     NSDictionary* aps = [userInfo valueForKey:@"aps"]; 
     UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Notis" message:[aps valueForKey:@"alert"] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
     [alert show]; 

    } 
    else 
    { 
     UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; 
     tabBarController.selectedIndex=2; 
    [self loadStatisticsInBackground]; 
     [[UAPush shared] handleNotification:userInfo applicationState:application.applicationState]; 
    } 

    [[UAPush shared] resetBadge]; 
} 

그러나 내가 정의한 경보와 시스템 정의 된 두 개의 경보를 보여줍니다. 도움이 될 것입니다. 편집 : 좋습니다 .. 푸시 알림의 제목을 변경할 수없는 경우 앱이 포 그라운드에서 실행될 때 푸시 알림을 방지 할 수있는 방법이 있습니까? 내 앱이 언제 실행되는지 표시하고 싶지 않습니다. 전경?

+0

앱이 포 그라운드에서 실행 중일 때 푸시 알림을 방지 할 수있는 방법이 있습니까? 내 앱이 포 그라운드에서 실행될 때 표시하고 싶지 않습니다. – Blios

+0

'displayNotificationAlert :'메소드의 구현이 있습니까? ([Urban Airship iOS Library 4.0.0 도시 비행선 UAPushNotificationDelegate Protocol Reference (http://docs.urbanairship.com/reference/libraries/ios/latest/Protocols/UAPushNotificationDelegate.html#//api/name/)을 참조하십시오. displayNotificationAlert :)) –

+0

일부 대리인이이 메서드를 시작하도록 설정해야합니까? – Blios

답변

0

앱이 포 그라운드에서 실행되고 있는지 감지 할 수 있습니다. 앱이 포 그라운드에서 실행 중인지 감지 할 수 있으며 앱이 포그 라운드에서 실행 중인지 감지 할 수 있습니다. 그러면 애플리케이션이 didReceiveRemoteNotification :에서 UAPush으로 알림을 전달하지 않습니다.

+0

그럼 내 코드에서 내가 뭘 잘못 했니? – Blios

+0

@Blios이 질문에 대답하는 동안 코드를 변경했습니다. – CarmeloS

+0

내가 기대하는대로 아직 작동하지 않습니까? – Blios

관련 문제