Does the version of nodeJS have any bearing on the functionality of RC Push?

M Mark Nongkhlaw 3 years 6 months ago
83 1 0

I had used Windows version of Rhomobile Suite installer v5.1.1. I upgraded node and npm to version 0.12.7 (ia32) and 2.11.3 respectively as I could not install Ionic with the rather old versions of node and npm which were shipped with the RMS installer.

I tested RC Push, but I do not see any push messages in my Android device. I am using Rhoconnect-rb without any source adapters.However, I could login to Rhoconnect from the Rhodes client and syncing works fine. I wonder if it has anything to do with my node & npm upgrade.

I am giving here-under some snippets from the logs. I am hoping that they will help in resolving the problem :-

After starting Rhoconnect & Rails app :

Thin web server (v1.6.3 codename Protein Powder)
Maximum connections set to 1024
Listening on 0.0.0.0:9292, CTRL+C to stop
[4724][04:14:46.613 PM 2015-09-10] Use of the POST /api/source/save_adapter is d
eprecated. Use Rhoconnect API v1 instead.
10.179.22.5 - - [10/Sep/2015 16:14:46] "POST /api/source/save_adapter HTTP/1.1"
200 23 0.0624

After client logged in :

127.0.0.1 - - [10/Sep/2015 16:17:48] "POST /rc/v1/system/login HTTP/1.1" 200 19
0.0312
127.0.0.1 - - [10/Sep/2015 16:17:48] "GET /rc/v1/system/license HTTP/1.1" 200 12
4 0.0356
127.0.0.1 - - [10/Sep/2015 16:17:48] "GET /rc/v1/sources/type/app HTTP/1.1" 200
2 0.0100
127.0.0.1 - - [10/Sep/2015 16:17:48] "GET /rc/v1/system/appserver HTTP/1.1" 200
41 0.0100
127.0.0.1 - - [10/Sep/2015 16:17:53] "GET /rc/v1/users HTTP/1.1" 200 8 0.0156
127.0.0.1 - - [10/Sep/2015 16:17:54] "GET /rc/v1/sources/type/all HTTP/1.1" 200
2 0.0356
127.0.0.1 - - [10/Sep/2015 16:17:54] "GET /rc/v1/users/mark/clients HTTP/1.1" 20
0 71 0.0586
10.179.22.3 - - [10/Sep/2015 16:20:20] "POST /rc/v1/app/login HTTP/1.1" 200 - 0.
4368
10.179.22.3 - - [10/Sep/2015 16:20:29] "GET /app/v1/Product?p_size=2000&version=
3 HTTP/1.1" 200 270 0.6708
10.179.22.3 - - [10/Sep/2015 16:20:30] "GET /app/v1/Product?p_size=2000&version=
3&token=211134029011272 HTTP/1.1" 200 82 0.0936
10.179.22.3 - - [10/Sep/2015 16:21:02] "GET /app/v1/Product?p_size=2000&version=
3 HTTP/1.1" 200 82 0.0780
10.179.22.3 - - [10/Sep/2015 16:21:35] "GET /app/v1/Product?p_size=2000&version=
3 HTTP/1.1" 200 82 0.0780
10.179.22.3 - - [10/Sep/2015 16:22:07] "GET /app/v1/Product?p_size=2000&version=
3 HTTP/1.1" 200 82 0.0780

After Ping User from RC Console :

127.0.0.1 - - [10/Sep/2015 16:25:34] "GET /rc/v1/system/license HTTP/1.1" 200 12
4 0.0468
127.0.0.1 - - [10/Sep/2015 16:25:34] "GET /rc/v1/system/appserver HTTP/1.1" 200
41 0.0468
127.0.0.1 - - [10/Sep/2015 16:25:34] "GET /rc/v1/sources/type/app HTTP/1.1" 200
2 0.0468
127.0.0.1 - - [10/Sep/2015 16:25:35] "GET /rc/v1/users HTTP/1.1" 200 8 0.0586
127.0.0.1 - - [10/Sep/2015 16:25:43] "GET /rc/v1/users/mark/clients HTTP/1.1" 20
0 71 0.0426
127.0.0.1 - - [10/Sep/2015 16:25:43] "GET /rc/v1/sources/type/all HTTP/1.1" 200
11 0.0210
10.179.22.3 - - [10/Sep/2015 16:25:47] "GET /app/v1/Product?p_size=2000&version=
3 HTTP/1.1" 200 82 0.5910
127.0.0.1 - - [10/Sep/2015 16:25:52] "GET /rc/v1/sources/type/user HTTP/1.1" 200
11 0.0210
[4724][04:26:05.298 PM 2015-09-10] Skipping ping for non-registered client_id '2
9d89ec52a1337e3d271609a86d5b928'...
[4724][04:26:05.301 PM 2015-09-10] Skipping ping for non-registered client_id '0
a8ef2345198713993a7920c0a6fb555'...
127.0.0.1 - - [10/Sep/2015 16:26:05] "POST /rc/v1/users/ping HTTP/1.1" 200 - 0.0
540
127.0.0.1 - - [10/Sep/2015 16:26:05] "GET /rc/v1/users HTTP/1.1" 200 8 0.0120
10.179.22.3 - - [10/Sep/2015 16:26:19] "GET /app/v1/Product?p_size=2000&version=
3 HTTP/1.1" 200 82 0.0936
10.179.22.3 - - [10/Sep/2015 16:26:51] "GET /app/v1/Product?p_size=2000&version=
3 HTTP/1.1" 200 82 0.0780

RC Console :

Device: 29d89ec52a1337e3d271609a86d5b928

Attributes
rho__id 29d89ec52a1337e3d271609a86d5b928
user_id mark
last_sync 2015-09-10T16:24:10+05:30
app_id application

Starting rhoconnect-push :

D:\webstore-rc>rhoconnect-push -i 10.179.22.3 -d 3
## Configuration settings
{ debugLevel: 3,
  httpSecure: 'n',
  certificateAuthorityFile: undefined,
  appAuthHost: '10.179.22.3',
  appAuthPort: '9292',
  appAuthUrl: '/rc/v1/system/rps_login',
  userAuthHost: '10.179.22.3',
  userAuthPort: '9292',
  userAuthUrl: '/rc/v1/app/rps_login',
  ansServerPort: '8675',
  socketPoolSize: 5,
  ansResponseTimeout: 300000,
  authCredentialCacheEnabled: 'y',
  authCredentialCacheSize: 10,
  authCredentialLifetime: 60000,
  registrationTimeout: 2592000,
  clearDataBase: 'n',
  redisToGoUrl: 'redis://localhost:6379' }
&&&& userAuthOptions : { host: '10.179.22.3',
  path: '/rc/v1/app/rps_login',
  port: '9292',
  method: 'GET',
  headers: { connection: 'keep-alive', 'content-type': 'application/json' },
  agent:
   { domain: null,
     _events: { free: [Function] },
     _maxListeners: undefined,
     defaultPort: 80,
     protocol: 'http:',
     options: { path: null },
     requests: {},
     sockets: {},
     freeSockets: {},
     keepAliveMsecs: 1000,
     keepAlive: false,
     maxSockets: 5,
     maxFreeSockets: 256,
     freeSocketQueue: [],
     addRequest: [Function] } }
## RhoConnect push server: Listening on port 8675
RhoConnect push server started...

No further output from RC Push Server

Thanks.

Please Register or Login to post a reply

1 Replies

M Mark Nongkhlaw

I am giving my settings hereunder, if that will help further :

My rails version : 3.2.6 (running on a separate machine with IP: 10.179.22.5)

My RhoConnect app is running on 10.179.22.3

My rails model file (product.rb) :

class Product < ActiveRecord::Base
include Rhoconnect::Resource
#include Rhoconnectrb::Resource
def partition
lambda { "mark" }
end
def self.rhoconnect_query(partition, attributes = nil)
      Product.all
end
  attr_accessible :brand, :name, :price, :quantity, :sku
end

My rails initializer file (rhoconnect.rb) :

Rhoconnect.configure do |config|

  config.uri="http://10.179.22.3:9292"
  config.token="my-rhoconnect-token"
  config.app_endpoint="http://10.179.22.5:3000"
  config.authenticate=lambda { |credentials| return true }
 
end

RhoConnect settings.yml

#:sources:
#  Product:
#    :poll_interval: 300

:development:
  :licensefile: settings/license.key
  :redis: localhost:6379
  :syncserver: http://10.179.22.3:9292
  :push_server: http://someappname@localhost:8675/
  :api_token: my-rhoconnect-token
  :push_notify: true
:test:
  :licensefile: settings/license.key
  :redis: localhost:6379
  :syncserver: http://10.179.22.3:9292/api/application/
  :push_server: http://someappname@localhost:8675/
  :api_token: my-rhoconnect-token
  :push_notify: true
:production:
  :licensefile: settings/license.key
  :redis: localhost:6379
  :syncserver: http://10.179.22.3:9292
  :push_server: http://someappname@localhost:8675/
  :push_notify: true

Rhodes app rhoconfig.txt (relevant lines only)

syncserver = 'http://10.179.22.3:9292'
sync_poll_interval=30

# Add Rhoconnect Push Server URL
Push.rhoconnect.pushServer = 'http://10.179.22.3:8675'

# App Name token for push
Push.rhoconnect.pushAppname = 'someappname'

Rhodes app build.yml (relevant lines only)

android:
# Note: in order to simplify debugging only app messages and system channels with priority informative and higher, and any errors are enabled by default
  # version: "2.3.3"
  minSDK: 11
  logcatFilter: "APP:I StrictMode:I DEBUG:I *:E"
  extensions:
  - rhoconnect-client
  - json
  - rhoconnect-push

Rhodes app application.rb :

require 'rho/rhoapplication'

class AppApplication < Rho::RhoApplication
  def initialize
    # Tab items are loaded left->right, @tabs[0] is leftmost tab in the tab-bar
    # Super must be called *after* settings @tabs!
    @tabs = nil
    #To remove default toolbar uncomment next line:
    #@@toolbar = nil
    super

    # Added as per docs:
    #Rho::startNotifications '/app/Settings/push_callback'
    if SyncEngine::logged_in > 0
      Rho::Push.startNotifications '/app/Settings/push_callback'
    end
    # Uncomment to set sync notification callback to /app/Settings/sync_notify.
    # Rho::RhoConnectClient.setObjectNotification("/app/Settings/sync_notify")
    Rho::RhoConnectClient.setNotification('*', "/app/Settings/sync_notify", '')
  end
end

Rhodes app model file (product.rb)

# The model has already been created by the framework, and extends Rhom::RhomObject
# You can add more methods here
class Product
  include Rhom::PropertyBag
  # Uncomment the following line to enable sync with Product.
   enable :sync
  #add model specific code here
end

Rhodes app controller.rb :
  # Added as per docs:
 
  def push_callback
    Rho::Notification.showPopup({'message' => @params['alert'], 'buttons' => ['OK']})
  end

Is there anything wrong in the above settings that might be the cause for RC Push not working?

CONTACT
Can’t find what you’re looking for?