Where do I find "yourAppDelegate.m" ?? Ti.Cloud Question

You must Login before you can answer or comment on any questions.

So... I'm trying to put push notifications in my app... my in this part of guide:

Update your code to register for push notifications
 
In yourAppDelegate.m, add the following code after initializing Appcelerator Cloud Services in method didFinishLaunchingWithOptions:
I'm stuck because I can't find my appDelegate.m ... where it is?

— asked 11 months ago by Douglas Hennrich
1 Comment
  • "So... I'm trying to put push notifications in my app...in this part of guide:"

    — commented 11 months ago by Douglas Hennrich

3 Answers

windowFunctions['Settings for This Device'] = function (evt) {
    var win = createWindow();
    var offset = addBackButton(win);
    var content = Ti.UI.createScrollView({
        top: offset + u,
        contentHeight: 'auto',
        layout: 'vertical'
    });
    win.add(content);
 
    var enablePush = Ti.UI.createButton({
        top: 10, width: 320, height: 50,
        title: pushNotificationsEnabled ? 'Enabled' : 'Disabled'
    });
    enablePush.addEventListener('click', function () {
        if (!pushNotificationsEnabled) {
            enablePushNotifications();
        } else {
            disablePushNotifications();
        }
        enablePush.title = pushNotificationsEnabled ? 'Enabled' : 'Disabled';
    });
    content.add(enablePush);
 
    if (Ti.Platform.name === 'iPhone OS') {
        /*
         iOS doesn't let us make customizations here.
         The user can do this from the settings for the application.
         */
    }
    else if (Ti.Platform.name === 'android') {
        if (androidPushModule === null) {
            androidPushModule = getAndroidPushModule();
            if (androidPushModule === null) {
                return;
            }
        }
        /*
         Whether or not to show a tray notification.
         */
        var showTrayNotification = Ti.UI.createButton({
            top: 10, width: 320, height: 50,
            title: androidPushModule.showTrayNotification ? 'Show in Tray' : 'Do Not Show in Tray'
        });
        showTrayNotification.addEventListener('click', function () {
            androidPushModule.showTrayNotification = !androidPushModule.showTrayNotification;
            showTrayNotification.title = androidPushModule.showTrayNotification ? 'Show in Tray' : 'Do Not Show in Tray';
        });
        content.add(showTrayNotification);
 
        /*
         Whether or not clicking a tray notification focuses the app.
         */
        var showAppOnTrayClick = Ti.UI.createButton({
            top: 10, width: 320, height: 50,
            title: androidPushModule.showAppOnTrayClick ? 'Tray Click Shows App' : 'Tray Click Does Nothing'
        });
        showAppOnTrayClick.addEventListener('click', function () {
            androidPushModule.showAppOnTrayClick = !androidPushModule.showAppOnTrayClick;
            showAppOnTrayClick.title = androidPushModule.showAppOnTrayClick ? 'Tray Click Shows App' : 'Tray Click Does Nothing';
        });
        content.add(showAppOnTrayClick);
 
        /*
         Whether or not tray notifications are shown when the app is in the foreground.
         */
        var showTrayNotificationsWhenFocused = Ti.UI.createButton({
            top: 10, width: 320, height: 50,
            title: androidPushModule.showTrayNotificationsWhenFocused ? 'Show Trays when Focused' : 'Hide Trays when Focused'
        });
        showTrayNotificationsWhenFocused.addEventListener('click', function () {
            androidPushModule.showTrayNotificationsWhenFocused = !androidPushModule.showTrayNotificationsWhenFocused;
            showTrayNotificationsWhenFocused.title = androidPushModule.showTrayNotificationsWhenFocused ? 'Show Trays when Focused' : 'Hide Trays when Focused';
        });
        content.add(showTrayNotificationsWhenFocused);
 
        /*
         Whether or not receiving a push immediately brings the application to the foreground.
         */
        var focusAppOnPush = Ti.UI.createButton({
            top: 10, width: 320, height: 50,
            title: androidPushModule.focusAppOnPush ? 'Push Focuses App' : 'Push Doesn\'t Focus App'
        });
        focusAppOnPush.addEventListener('click', function () {
            androidPushModule.focusAppOnPush = !androidPushModule.focusAppOnPush;
            focusAppOnPush.title = androidPushModule.focusAppOnPush ? 'Push Focuses App' : 'Push Doesn\'t Focus App';
        });
        content.add(focusAppOnPush);
    }
 
    win.open();
};
I'm using the Ti.Cloud sample from titanium...

and I'm trying to test push notifications.... I already do the provising stuffs and upload my certificate to cloud.appcelerator.... and I have already enable my device for receive pushs notification through application sample but when I go to my app control settings my device isn't registered for receive push notifications oO ( it's and iOS device )

Someone knows how to do for register my device?

This is part of the non Ti.Cloud module instructions.

You need to be taking a look at the instructions in combination with the information under Ti.Cloud at docs.appcelerator.com

— answered 11 months ago by Stephen Feather
answer permalink
8 Comments
  • Push for IOS

    Special extra for android

    — commented 11 months ago by Stephen Feather

  • I already see this... and in this guide that I'm stuck... when I need to update my code to register for push notification... it says to me open my appdelegate.m but I don't know where is... and that is my question... where do I found my appdelegate.m??

    — commented 11 months ago by Diego Hennrich

  • how about you be a bit more helpful and post a link to the guide you are following, eh mate?

    — commented 11 months ago by Stephen Feather

  • Show 5 more comments

Hi Douglas, you don't really need to find appDelegate.m file if using ACS with titanium, but yes for native Project when you create a project, it always create a appDelegate.h/.m file automatically and they are referring that in the TiCloud documentation.

— answered 9 months ago by Ashish Nigam
answer permalink
3 Comments
  • Ashish,

    Your points trolling has been noted. You are not adding anything of value to the discussions be parroting answers already given.

    Your Q&A activity is being looked into now.

    — commented 9 months ago by Stephen Feather

  • Stephen it seems like, if you want to answer only then go ahead, but answering my way, your answer sucks. what do you mean by non TiCloud module, its related to ACS confusion and setting up path which is explained in iOS SDK of ACS, where i found Douglas seems to be confusing.

    so i answered about native projects and there is no need in Titanium. Stop suggesting me, and have your suggestions till your reach.

    i was wrong at one point where i gave reference of your answer in my answer but i did not use comments section of your answer and put it separately. so i corrected my way.

    But rest don't think that other are copying your answers. just live in your world.

    — commented 9 months ago by Ashish Nigam

  • and to answer you last line, Your Q&A activity is being looked into now. sure you look, at least you will learn something, which you need most. i try to help whenever i get time.

    and i will get some good response from you, to improve my ways and How to make other understand better.

    — commented 9 months ago by Ashish Nigam

Your Answer

Think you can help? Login to answer this question!