Q:

Could not find appSecret for push notification services on IBM bluemix cloud

I would like to use a PushNotinfication service via Java application so that I need appGuid and appSecret of the service. (The figure attached to this message shows the window that appSecret is supposed to be shown but it didn't.) enter image description hereSome documents say that appSecret is automatically generated when an application is bound to the service but I cannot understand about the binding process.
So I would like to know the process to issue appSecret of the PushNotification Service as detail as possible. I would appreciate if someone could explain with the screen shot of the window of each process.

A:

@ken We support both AppSecret and Tokens in the swagger(http://imfpush.ng.bluemix.net/imfpush/). For new instances created there would not be any AppSecret as these are IAM based instances. And there is no way other than the Token way of authentication.
Those instances created before June 2018 will work with Appsecret. But the new instances will work only with IAM token. This is introduced for better security. Please refer to our release notes for the same https://console.bluemix.net/docs/services/mobilepush/release-notes.html#release-notes.
To know more on the IAM implementation on the Push Notification service please refer to https://console.bluemix.net/docs/services/mobilepush/push_iam.html#service-access-management
Refer to the question 21 in our FAQ section https://console.bluemix.net/docs/services/mobilepush/push_faq.html#faq to know how to retrieve the token and use.
Regarding the Swagger a new Authorization field is introduced to submit the IAM token. Either the Authorization field or the appSecret is mandatory.

Please refer to the server sdk (https://github.com/ibm-bluemix-mobile-services/bms-pushnotifications-serversdk-java) readme file where customer has to Initialize Push with ApiKey for the new push instance that IAM token is automatically generated by initialization method..
PushNotifications.initWithApiKey("YOUR_APPLICATION_ID", "YOUR-BLUEMIX-PUSH-APIKEY", PushNotifications.US_SOUTH_REGION);

Sample
public static void main(String[] args) {

    PushNotifications.initWithApiKey("appId", "APIKey", PushNotifications.US_SOUTH_REGION);
    Message message = new Message.Builder().alert("20% Off Offer for you").url("www.ibm.com").build();
    String [] deviceIds = {"deviceIds"};
    Target target = new Target.Builder().deviceIds(deviceIds).build();

    Notification notification = new Notification.Builder().message(message).target(target).build(); 
    PushNotifications.send(notification, new PushNotificationsResponseListener(){

        public void onSuccess(int statusCode, String responseBody) {
            System.out.println(responseBody);
            System.out.println("Successfully sent push notification! Status code: " + statusCode + " Response body: " + responseBody);
        }

        public void onFailure(Integer statusCode, String responseBody, Throwable t) {
            System.out.println("Failed sent push notification. Status code: " + statusCode + " Response body: " + responseBody);
            if(t != null){
                t.printStackTrace();
            }
        }
    });
}

Hope this helps.

