Subversion Repositories SmartDukaan

Rev

Rev 16294 | Rev 16350 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16294 Rev 16295
Line 106... Line 106...
106
                pushpostrequest = urllib2.Request('http://api.profittill.com/pushnotifications/generateAffiliateUrl', encoded_url_params, headers=aff_url_headers)
106
                pushpostrequest = urllib2.Request('http://api.profittill.com/pushnotifications/generateAffiliateUrl', encoded_url_params, headers=aff_url_headers)
107
                pushpostrequest.add_header("Authorization", "Basic %s" % DTR_API_BASIC_AUTH)
107
                pushpostrequest.add_header("Authorization", "Basic %s" % DTR_API_BASIC_AUTH)
108
                json_result =  json.loads(urllib2.urlopen(pushpostrequest).read())
108
                json_result =  json.loads(urllib2.urlopen(pushpostrequest).read())
109
                notificationRecord.url = json_result['url']
109
                notificationRecord.url = json_result['url']
110
                logging.debug('User Id:-'+str(notificationRecord.userId)+' Notification Url:- '+ str(notificationRecord.url))
110
                logging.debug('User Id:-'+str(notificationRecord.userId)+' Notification Url:- '+ str(notificationRecord.url))
-
 
111
            else:
-
 
112
                notificationRecord.url = notificationRecord.url+'?user_id='+str(notificationRecord.userId)
111
            
113
            
112
            data = {"message":notificationRecord.message,"cid":notificationRecord.campaignId,"title":notificationRecord.title,
114
            data = {"message":notificationRecord.message,"cid":notificationRecord.campaignId,"title":notificationRecord.title,
113
                    "type":notificationRecord.type,"url":notificationRecord.url,"vibrate":1,"sound":1,"largeIcon":"large_icon",
115
                    "type":notificationRecord.type,"url":notificationRecord.url,"vibrate":1,"sound":1,"largeIcon":"large_icon",
114
                    "smallIcon":"small_icon"}
116
                    "smallIcon":"small_icon"}
115
            
117